0
Я тестирую некоторые доступные датчики, и я показываю значения каждого датчика в текстовом виде .ScrollView заставляет приложение сбой
Но когда я приложил все текстовые изображения внутри scrollView, приложение разбилось.
Примечание: мой Scrollview уже заключен внутри LinearLayout
Пожалуйста найдете ниже файл .xml.
XML:
<ScrollView
android:isScrollContainer="true"
android:scrollbars="vertical"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/accelerometer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=" Accelerometer " />
<TextView
android:id="@+id/acc_tv01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="X = " />
<TextView
android:id="@+id/acc_tv01Value"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/acc_tv02"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Y = " />
<TextView
android:id="@+id/acc_tv02Value"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/acc_tv03"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Z = " />
<TextView
android:id="@+id/acc_tv03Value"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/Orientation"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=" Orientation " />
<TextView
android:id="@+id/orient_tv01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="X = " />
<TextView
android:id="@+id/orient_tv01Value"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/orient_tv02"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Y = " />
<TextView
android:id="@+id/orient_tv02Value"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/orient_tv03"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Z = " />
<TextView
android:id="@+id/orient_tv03Value"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/Magnetometer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=" Magnetometer " />
<TextView
android:id="@+id/magnet_tv01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="X = " />
<TextView
android:id="@+id/magnet_tv01Value"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/magnet_tv02"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Y = " />
<TextView
android:id="@+id/magnet_tv02Value"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/magnet_tv03"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Z = " />
<TextView
android:id="@+id/magnet_tv03Value"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/Gyroscope"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=" Gyroscope " />
<TextView
android:id="@+id/gyro_tv01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="X = " />
<TextView
android:id="@+id/gyro_tv01Value"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/gyro_tv02"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Y = " />
<TextView
android:id="@+id/gyro_tv02Value"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/gyro_tv03"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Z = " />
<TextView
android:id="@+id/gyro_tv03Value"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</ScrollView>
я думал, что это уже отредактирован? Я вложил файл xml между '' – Androelpha
, разместив ваш файл журнала. –
Думаю, вы должны приложить свой прокрутки в линейном макете. –