Android: two spinners beside
I have price values which I want to show in 2 different spinners beside: "from" a开发者_如何学运维nd "to", I want to have two spinners showing beside eachother, One of them will contain "from values" and the other one "to values"
How is this possible in android?
You can use table layout, something like this in your layout XML:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:stretchColumns="0,1,2"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:gravity="center">
<TableRow>
<Spinner android:id="@+id/widget1" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:drawSelectorOnTop="false" />
<Spinner android:id="@+id/widget2" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:drawSelectorOnTop="false" />
</TableRow>
</TableLayout>
I did not compile this or make sure it will work, this is just to give you an idea.
good luck!
精彩评论