親愛なるすべての専門家私がscrollViewの使用に問題がある人は誰でも助けてください..エラーはScrollViewが役に立たないことを示しており、他の形式でも同じことを示しています、これを解決するにはどうすればよいですか?スクロール??
`
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="30dp"
android:text="@string/welcome"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_gravity="center"
android:layout_margin="30dp"
android:contentDescription="@+id/button1"
android:src="@drawable/ic_launcher" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:orientation="horizontal" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/username"
android:textAppearance="?android:attr/textAppearanceSmall" />
<EditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="text" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/password"
android:textAppearance="?android:attr/textAppearanceSmall" />
<EditText
android:id="@+id/editText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:orientation="vertical" >
<Button
android:id="@+id/button1"
style="android:buttonStyle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:onClick="goToMain"
android:text="@string/log_in" />
<Button
android:id="@+id/button2"
style="android:buttonStyle "
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:onClick="register"
android:text="@string/registration" />
</LinearLayout>
</ScrollView>
`
あなたは、などの子コンテナを必要とするLinearLayout
、TableLayout
またはRelativeLayout
自分の中でScrollView
このように:
<ScrollView
... >
<LinearLayout
... >
<!-- Your views: TextView, LinearLayout, etc. -->
</LinearLayout>
</ScrollView>
参考文献によると:
ScrollViewはFrameLayoutです。つまり、スクロールするコンテンツ全体を含む1つの子をその中に配置する必要があります。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加