カスタムスピナーを作成しましたが、サイズが希望どおりではありません。スピナーは、必要なリストの間隔を取得するために非常に大きくなります。スピナーボタンのサイズとは関係なく、スピナーの行のサイズを変更できるようにしたい。スピナーを薄くしてから、セクションの行の間隔を広くしたい。(下の画像を参照):
現在、スピナーの行のxmlは次のとおりです。
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:padding="5dip">
<ImageView android:layout_width="32sp" android:src="@drawable/icon"
android:id="@+id/spinnerimage" android:layout_height="32sp" />
<TextView android:textSize="22sp" android:textStyle="bold" android:textColor="#000"
android:layout_width="fill_parent" android:id="@+id/category"
android:layout_height="fill_parent" android:paddingLeft="5sp" />
</TableRow>
</TableLayout>
相対レイアウトを使用したかったのですが、テーブルレイアウトの方が少し間隔が広くなりました。高さを作成しようとすると、行のテキストとアイコンが切り取られます。main.xmlのスピナーは次のとおりです。
<Spinner android:id="@+id/catspinner"
android:layout_marginLeft="25dip" android:layout_marginRight="25dip"
android:layout_width="fill_parent" android:layout_centerHorizontal="true"
android:layout_height="wrap_content" android:prompt="@string/prompt"
android:background="@drawable/yellow_btn"
android:layout_centerVertical="true" android:drawSelectorOnTop="true" />
スピナーのサイズを標準のAndroidスピナー(右側)と同じにしたいのですが、現在、スピナーが大きくなり、行の間隔が小さすぎます。
何か案は??