我只是想用两个TextViews(并排连续)制作单选列表视图。单选ListView自定义行布局
其实我想让它让用户根据它的大小价格值选择一个产品。 这些值在那个ListView中显示,这两个TextView代表Size-Price值。
问题是,我不能使它成为一个单选列表(也显示在它前面的单选按钮)。以下是我正在使用的行布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:id="@+id/rowLayout" >
<TextView
android:id="@+id/tv_size"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:text="Size"
android:textSize="15sp" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Price"
android:textSize="15sp" />
<RadioButton
android:id="@+id/radioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right" />
</LinearLayout>
请告诉如何使用Java编写代码。 如果simple_list_item_2布局可行,那么该怎么做?
我已经回答了类似的问题:http://stackoverflow.com/questions/8295560/listview-with-checkbox-why-the-checkbox-doesnt-show – QuickNick