Я разместил ImageView в верхней части RelativeLayout, но изображение не отображается в верхней части страницы. Я искал в Интернете, и я добавил android:scaleType="fitStart"
, и проблема была решена, но изображение получает больше места на странице, потому что, когда я добавляю второе изображение под этим изображением, второе изображение отображается в центре страницы! В чем проблема? Как я могу это решить? Я попытался использовать LinearLayout
, который дает тот же результат.Show ImageView top of RelativeLayout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:id="@+id/registerAction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:scaleType="fitStart"
android:src="@drawable/register_action" />
<ImageView
android:id="@+id/registerLogo"
android:src="@drawable/app_pass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_below="@id/registerAction"/>
<EditText
android:id="@+id/pass1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/registerLogo"
android:paddingTop="15dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:inputType="textPassword"
android:hint="@string/pass1"
android:gravity="right"/>
<EditText
android:id="@+id/pass2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/pass1"
android:paddingTop="15dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:inputType="textPassword"
android:hint="@string/pass2"
android:gravity="right"/>
<Button
android:id="@+id/btn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/pass2"
android:paddingRight="10dp"
android:paddingLeft="10dp"
android:paddingTop="30dp"/>
</RelativeLayout>
Thanks.Cheers
EDIT: и еще один вопрос, как я могу обивка кнопка 30dp в снизу EditText? когда я изменил PaddingTop of Button, не изменилось положение кнопки.
Вы можете показать нам изображения, что вам нужно. это поможет нам больше. – Hariharan