【发布时间】:2012-02-25 19:17:58
【问题描述】:
我是这个社区的新手,也是安卓开发的新手。 为了我的学习,我需要做一个(是/否)问卷,分为3组,有些问题很长,所以我想把一部分做成大文本,下面另一部分做成小文本。
我从 dev.and.com 上的教程中制作了一个 TabLayout,目前我还有一个 LinearLayout 来回答我的问题
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="2dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/text_large"
android:textSize="16sp">
</TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/text_small"
android:textSize="12sp">
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="2dp"
android:gravity="right">
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/checkBxc">
</CheckBox>
</LinearLayout>
</LinearLayout>
所有组都一样。
tabLayout 的代码类似于here
而 AgroupActivity 现在只显示一行文本(用于测试目的)。
如何使我的布局看起来像我拥有的每个选项卡中的列表?或者也许还有其他一些可能性?据我了解,一个简单的 ListView 的标签中不能有任何东西(在我的例子中是复选框)?
【问题讨论】:
标签: android listview android-layout