Hi Mark, Thank you so much for your introduction for StateListDrawable. I didn't reach the document, but it looks the way I wanted. I will try it later.
Thank you again. On 9月24日, 午前11:15, "Mark Murphy" <[email protected]> wrote: > > I have a question about atabicon. > > > According to TabHost.TabSpec > > http://developer.android.com/intl/ja/reference/android/widget/TabHost... > > I can set only oneiconfor eachtabwith setIndicator(), but also > > according toIconDesign Guidelines > > http://developer.android.com/intl/ja/guide/practices/ui_guidelines/ic... > >tabiconhave two states. Can PNG image have two states? > > A PNG cannot have two states, but a StateListDrawable can. You can define > one of these in XML and put it in your res/drawable/ directory, > referencing it as if it were a PNG or JPEG file. > > For example, here is a StateListDrawable for a pair of PNGs to serve as a > singletabicon: > > <selector xmlns:android="http://schemas.android.com/apk/res/android"> > <item > android:state_selected="true" > android:state_pressed="false" > android:drawable="@drawable/tab1_selected" > /> > <item > android:drawable="@drawable/tab1_normal" > /> > </selector> > > If you named this as res/drawable/tab1.xml, and also had > res/drawable/tab1_selected.png and res/drawable/tab1_normal.png, you could > reference this "icon" as R.drawable.tab1 in your TabSpec work, and you > would get a two-stateicon. > > -- > Mark Murphy (a Commons Guy)http://commonsware.com > Android App Developer Books:http://commonsware.com/books.html --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

