【发布时间】:2014-12-01 11:49:05
【问题描述】:
我有一个 RelativeLayout,我有一些视图(图像和编辑文本),现在我想使用滚动视图。这是我的 xml 代码
<RelativeLayout
android:id="@+id/relativeLayout2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_marginTop="70dp" >
<ImageView
android:id="@+id/loginbtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/passwordfild"
android:layout_alignRight="@+id/passwordfild"
android:layout_below="@+id/passwordfild"
android:layout_marginTop="28dp"
android:background="@drawable/login"
android:textColor="#ffffff" />
<EditText
android:id="@+id/passwordfild"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/namefild"
android:layout_alignRight="@+id/namefild"
android:layout_centerVertical="true"
android:background="@drawable/edittextbackground"
android:ems="10"
android:hint="პაროლი"
android:inputType="textPassword"
android:paddingLeft="15dp"
android:textColorHint="#e2e0e0" >
<requestFocus />
</EditText>
<EditText
android:id="@+id/namefild"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/passwordfild"
android:layout_marginBottom="42dp"
android:layout_marginLeft="175dp"
android:layout_marginRight="175dp"
android:background="@drawable/edittextbackground"
android:ems="10"
android:hint="სახელი"
android:paddingLeft="15dp"
android:textColorHint="#e2e0e0" >
<requestFocus />
</EditText>
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/namefild"
android:layout_alignLeft="@+id/namefild"
android:layout_alignRight="@+id/namefild"
android:layout_marginBottom="100dp"
android:background="@drawable/icon" />
</RelativeLayout>
我也加了
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="70dp" >
我在我的滚动视图中插入了我的相对布局,但设计已经改变。我不知道我做错了什么 如果有人知道解决方案,请帮助我
【问题讨论】:
-
还有什么问题?
标签: android android-activity android-scrollview android-relativelayout