Tôi đang cố gắng tạo tiện ích con cho ứng dụng, sau đây là bố cục tôi đang sử dụng. Tôi đã cố thêm chế độ xem cuộn vào phần thứ hai của tiện ích. Tôi không thể làm điều đó, Khi tôi xóa thẻ, tiện ích con đang được hiển thị, nhưng khi có thẻ, android không thể tải tiện ích. Tôi gãi đầu với điều này trong hai ngày. Tôi không hiểu tôi đang làm gì sai?Không thể thêm <ScrollView> vào bố cục tiện ích con ứng dụng android
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/background_light"
>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:color/background_dark"
android:id="@+id/widgetHeader"
>
<Button
android:background="@drawable/icon_quickword"
android:id="@+id/widgetBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_margin="5sp"
/>
<TextView android:text="@string/widget_title1"
android:id="@+id/widget_title1"
android:textSize="18sp"
android:textStyle="bold"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="@android:color/white"
android:layout_toRightOf="@id/widgetBtn"
android:layout_marginLeft="2sp"
/>
<TextView android:text="@string/widget_title2"
android:id="@+id/widget_title2"
android:textSize="15sp"
android:textStyle="italic"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="@android:color/white"
android:layout_toRightOf="@id/widgetBtn"
android:layout_below="@id/widget_title1"
android:layout_marginLeft="3sp"
/>
</RelativeLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:id="@+id/widgetContent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@android:color/white"
>
<TextView android:text="@string/widget_content_info1"
android:id="@+id/widget_content_info1"
android:textStyle="bold"
android:textSize="16sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="@android:color/black" />
<TextView android:text="@string/widget_content_info2"
android:id="@+id/widget_content_info2"
android:textSize="14sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="@android:color/black" />
<TextView android:text="@string/widget_content_info3"
android:id="@+id/widget_content_info3"
android:textSize="14sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="@android:color/black" />
</LinearLayout>
</ScrollView>
</LinearLayout>
Sử dụng một ListView thay –