ScrollVie滚动条
16lz
2021-01-23
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<!-- 滚动条 -->
<!-- 每个ScrollView控件里面只能包含一个子元素、如果有多个子元素可用现行布局包裹起来 -->
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:id="@+id/linear"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal">
<!-- 图片控件 -->
<ImageView
android:id="@+id/img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:src="@drawable/a" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world"
android:textSize="30sp" />
</LinearLayout>
</ScrollView>
</LinearLayout>
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<!-- 滚动条 -->
<!-- 每个ScrollView控件里面只能包含一个子元素、如果有多个子元素可用现行布局包裹起来 -->
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:id="@+id/linear"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal">
<!-- 图片控件 -->
<ImageView
android:id="@+id/img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:src="@drawable/a" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world"
android:textSize="30sp" />
</LinearLayout>
</ScrollView>
</LinearLayout>
更多相关文章
- android控件相对布局
- Android CheckBox控件使用OnClickListener和OnCheckedChangeList
- Android 基本控件
- Android下拉刷新控件
- android之AutoCompleteTextView控件用法
- 控件属性:
- Android:控件GridView的使用实例
- 系出名门Android(5) - 控件(View)