スクロールビューにテキストとイメージを交互に表示しようとしています。ただし、アプリケーションを実行しようとすると、コードにエラーはありません。その力は閉じる。私はアンドロイドスタジオの新人です。これをどうすれば解決できますか?私はここで答えを検索しようとしましたが、私が探している解決策を見つけることができません。ここでスクロールビュー内のテキストビューとイメージビューの交互
は私のコード
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity ="center"
android:fillViewport="true"
android:layout_alignParentStart="true"
android:layout_marginTop="0dp"
android:id="@+id/scrollView">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textColor="#000"
android:textColorLink="@android:color/black"
android:textSize="18sp"
android:text="hello"/>
<ImageView
android:layout_width="15dp"
android:layout_height="15dp"
android:src="@drawable/cheese_1"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textColor="#000"
android:textColorLink="@android:color/black"
android:textSize="18sp"
android:text="hi" />
<ImageView
android:layout_width="15dp"
android:layout_height="15dp"
android:src="@drawable/cheese_2"/>
</ScrollView>
</LinearLayout>
ポストを次のようにそののLinearLayoutにscrollviewの子として線形レイアウトや子供など、すべての画像およびtextviewsをscrollview.Addする唯一の直接の子を持つことができますscrollview使用したい場合あなたのJavaクラスとlogcatも –