Kısa bir süre önce Android uygulamamıza stil tabanlı yaklaşmayı denedim. Ancak, bu ikilem ile sıkışıp kaldım. Hayır şans ile bunu denedim benim styles.xml olarakAndroid stili özelliği nasıl devralınır?
<LinearLayout
android:id="@+id/layout_event_buttons"
style="?android:attr/buttonBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal" >
<ImageButton
android:id="@+id/btn_create_event"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/btn_save"
android:src="@drawable/content_save"
android:text="@string/btn_save" />
</LinearLayout>
: Benim düzeni dosyasında
Başlangıçta bu vardı zaten yukarıda farklı varyasyonlar denedi
<style name="Buttons" parent="?android:attr/buttonBarButtonStyle">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
</style>
gibi:
?android:buttonBarButtonStyle
?attr:buttonBarButtonStyle
@android:attr/buttonBarButtonStyle
@android:buttonBarButtonStyle
Ben de denedim:
<item name="style">?android:attr/buttonBarButtonStyle</item>
boşuna.
Uygulamam, buttonBarButtonStyle kaynağını bulamadığı için derlenmeyecek.
Nasıl uygulandığım budur. Sadece Holo gibi ortak temaları miras eğer Benim diğer stilleri vb iyi çalışır
<ImageButton
style="@style/Buttons"
android:id="@+id/btn_create_event"
android:contentDescription="@string/btn_save"
android:src="@drawable/content_save"
android:text="@string/btn_save" />
bunu açıklıyor Bu arada, benim manifestosunda bu Bu yüzden desteklenmeyen bir API'den çalıştırdığımı sanmıyorum –
Chad