私はスピナーにカスタムの背景を与えようとしています。私は、9パッチ形式のHTCセンススピナーデザイン(写真に続くもの)をダウンロードしました。Android - カスタムスピナーの背景に関する問題
私の中に、次のコードで新しいXMLファイルを作成しました:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_focused="true"
android:state_pressed="false"
android:drawable="@drawable/spinner_pressed" />
<item
android:state_focused="true"
android:state_pressed="true"
android:drawable="@drawable/spinner_pressed" />
<item
android:state_focused="false"
android:state_pressed="true"
android:drawable="@drawable/spinner_pressed" />
<item
android:drawable="@drawable/spinner_normal" />
</selector>
をそして私は、このコードで私のレイアウトにスピナーを追加しました:
<Spinner
android:id="@+id/my_spinner"
android:layout_width="180dp"
android:layout_height="50dp"
android:layout_marginLeft="20dp"
android:background="@drawable/custom_spinner" />
正しく表示されているのに対し、私は次の形式を持っています。
私は間違っていましたか?
私があなたを助けてくれることを願っています。
よろしくお願いいたします。あなたの9パッチ上に定義され
V.
whats the problem ...?それは大丈夫です...それは高さか正確にはうまくいかない... – ngesh
このリンクを確認してください:[スピナー](http://stackoverflow.com/questions/9923269/modify-the-size-of-an -android-spinner-drop-down-part-size/9923516#9923516)私は同様の質問に答えました。それがあなたに役立つことを願っています。 –
その冗長性と呼ばれる! –