请帮我两个添加按钮后面的滚动视图(即)从病房的半按钮开始滚动请帮我设计如何设计
答案 0 :(得分:0)
试试这段代码,滚动视图是从按钮到开始的一半,很多TextView用于检查滚动视图。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignTop="@+id/button1"
android:layout_marginLeft="22dp"
android:layout_marginTop="20dp" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Large TextLarge TextLarge TextLarge
Large TextLarge TextLarge TextLarge TextLarge Text
Large TextLarge TextLarge TextLarge TextLarge Text
Large TextLarge TextLarge TextLarge TextLarge Text
Large TextLarge TextLarge TextLarge TextLarge Text
Large TextLarge TextLarge TextLarge TextLarge Text
Large TextLarge TextLarge TextLarge TextLarge Text
Large TextLarge TextLarge TextLarge TextLarge Text
Large TextLarge TextLarge TextLarge TextLarge Text
Large TextLarge TextLarge TextLarge TextLarge Text
Large TextLarge TextLarge TextLarge TextLarge Text
Large TextLarge TextLarge TextLarge TextLarge Text
Large TextLarge TextLarge TextLarge TextLarge Text
Large TextLarge TextLarge TextLarge TextLarge Text
Large TextLarge TextLarge TextLarge TextLarge Text
Large TextLarge TextLarge TextLarge TextLarge Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
</ScrollView>
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/scrollView1"
android:layout_alignParentTop="true"
android:layout_marginLeft="39dp"
android:layout_marginRight="39dp"
android:background="#ffff55"
android:text="Button" />
</RelativeLayout>