In the following code:
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="vertical">
<TextView
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="27sp"
android:text="#string/create_card_text"/>
<TextView
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="24sp"
android:textColor="#ff949494"
android:text="#string/create_card_info_text_one"/>
<EditText
android:id="#+id/name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:hint="Name"/>
<EditText
android:id="#+id/email"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:inputType="textEmailAddress"
android:hint="Email"/>
<TextView
android:id="#+id/phone_number"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:hint="Phone Number"/>
<Button
android:id="#+id/next_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginLeft="280dp"
android:text="#string/create_card_next_button"
android:onClick="next"/>
</LinearLayout>
</ScrollView>
The button just does not shows up. What could be wrong?
Try like this.
You have set android:layout_marginLeft="280dp" so replace this with
android:layout_marginLeft="20dp" or something else
so basically your button's code will look something like this
<Button
android:id="#+id/next_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:text="#string/create_card_next_button"
android:onClick="next"/>
I think you have set margin left to 280dp which is causing problem and making it out of your screen set it to 20dp or as per your screen requirement as you have set other and it should work.
Related
I am a beginner in Android Studios, and my TextViews will not be placed next to each other, instead one is on top of the other. I am really confused about what I did wrong.
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal" />
<TextView
android:layout_width="wrap_content"
android:layout_height="35dp"
android:text="#string/already_registered"/>
<TextView
android:id="#+id/textview_login"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:paddingLeft="10dp"
android:textStyle="bold"
android:textColor="#ECAB71"
android:textSize="16sp"
android:text="#string/login"/>
</LinearLayout>
LinearLayout tag closed too early. Use > instead of /> in your LinearLayout element.
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="35dp"
android:text="Already registered"/>
<TextView
android:id="#+id/textview_login"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:paddingLeft="10dp"
android:textStyle="bold"
android:textColor="#ECAB71"
android:textSize="16sp"
android:text="login"/>
</LinearLayout>
You must clear the backslash in line 5
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="35dp"
android:text="#string/already_registered"/>
<TextView
android:id="#+id/textview_login"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:paddingLeft="10dp"
android:textStyle="bold"
android:textColor="#ECAB71"
android:textSize="16sp"
android:text="#string/login"/>
</LinearLayout>
If you notice the EditText views for Email and Password, the line isn't centered. In the design and preview modes in Android Studio, they looked centered, but when I ran it on my phone this is what showed. I'm having trouble making it centered. Here's my code of what it currently is:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/email"
android:id="#+id/emailTextLabel"
android:layout_marginTop="42dp"
android:layout_alignParentTop="true"
android:layout_alignLeft="#+id/passwordTextLabel"
android:layout_alignStart="#+id/passwordTextLabel"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/password"
android:id="#+id/passwordTextLabel"
android:layout_marginLeft="27dp"
android:layout_marginStart="27dp"
android:layout_marginTop="50dp"
android:layout_below="#+id/emailTextLabel"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"/>
<EditText
android:layout_width="325dp"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:ems="10"
android:id="#+id/emailEditText"
android:layout_below="#+id/emailTextLabel"
android:layout_alignLeft="#+id/emailTextLabel"
android:layout_alignStart="#+id/emailTextLabel"/>
<EditText
android:layout_width="325dp"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:ems="10"
android:id="#+id/passwordEditText"
android:layout_below="#+id/passwordTextLabel"
android:layout_alignLeft="#+id/passwordTextLabel"
android:layout_alignStart="#+id/passwordTextLabel"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/keep_me_signed_in"
android:id="#+id/keepMeSignedInCheckBox"
android:layout_below="#+id/passwordEditText"
android:layout_alignLeft="#+id/passwordEditText"
android:layout_alignStart="#+id/passwordEditText"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/sign_in"
android:id="#+id/sign_in_button"
android:layout_alignTop="#+id/sign_up_button"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="90dp"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/sign_up"
android:id="#+id/sign_up_button"
android:layout_marginTop="40dp"
android:layout_below="#+id/keepMeSignedInCheckBox"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginRight="90dp"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/use_without_account"
android:id="#+id/use_without_account_button"
android:layout_marginTop="8dp"
android:layout_below="#+id/sign_in_button"
android:layout_centerHorizontal="true"/>
</RelativeLayout>
set EditText width to match_parent and give margin from left and right, and remove android:layout_alignLeft , android:layout_alignStart
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:ems="10"
android:layout_marginLeft="27dp"
android:layout_marginRight="27dp"
android:id="#+id/emailEditText"
android:layout_below="#+id/emailTextLabel"/>
Using android:layout_centerHorizontal="true" is best solution for centering views
<EditText
android:id="#+id/note_title"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:hint="Тема"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:textCursorDrawable="#null"/>
</RelativeLayout>
I am new all around design of UI inn android. and i have a 3 alignments problem in the follwoing image:
1. i would like that the rotatte laeft and right will be under the cent of the butoom "Select Photo".
2. for some reason the spinner near to the mobile edit text is not in the hegiht of the mobile edittext.
3.the "Create Account" buttom should be in the Bottom of the screen. but even when i add the following line:
android:layout_alignParentBottom="true"
nothing happend.
this is what i get in my device:
this is the xml code:
<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:orientation="vertical"
android:background="#ffffffff"
tools:context="com.example.matant.gpsportclient.Controllers.Register">
<RelativeLayout
android:layout_width="match_parent"
android:id="#+id/submainLayout"
android:layout_margin="10dp"
android:layout_height="match_parent">
<ImageView
android:src="#drawable/camera"
android:layout_width="120dp"
android:layout_height="120dp"
android:id="#+id/imageViewGallery"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:background="#drawable/border"
android:padding="1dp"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:layout_alignParentStart="true" />
<TableRow
android:layout_width="match_parent"
android:id="#+id/signupRow1"
android:layout_height="wrap_content">
<EditText
android:layout_width="match_parent"
android:layout_height="40dp"
android:inputType="textPersonName"
android:ems="10"
android:id="#+id/editTextName"
android:hint="Name"
android:background="#drawable/rounded_edit_text"
android:paddingLeft="10dp"
android:layout_marginTop="160dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:id="#+id/signupRow2"
android:layout_below="#+id/signupRow1"
android:layout_marginTop="5dp"
android:layout_height="wrap_content">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:ems="10"
android:id="#+id/editTextEmail"
android:background="#drawable/rounded_edit_text"
android:padding="10dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:hint="Email"
/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:id="#+id/signupRow3"
android:layout_marginTop="5dp"
android:layout_below="#+id/signupRow2"
android:layout_height="wrap_content">
<Spinner
android:layout_width="0dp"
android:layout_height="match_parent"
android:id="#+id/spinnerMobile"
android:layout_marginRight="5dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:spinnerMode="dialog"
android:layout_marginBottom="5dp"
android:background="#606060"
android:layout_toLeftOf="#+id/buttonSelectImg"
android:layout_toStartOf="#+id/buttonSelectImg"
android:layout_below="#+id/editTextEmail"
android:layout_alignBottom="#+id/editTextMobile"
android:layout_weight="21.24" />
<EditText
android:layout_width="0dp"
android:layout_height="match_parent"
android:inputType="phone"
android:ems="10"
android:id="#+id/editTextMobile"
android:paddingLeft="5dp"
android:layout_marginTop="5dp"
android:background="#drawable/rounded_edit_text"
android:hint="Mobile"
android:layout_weight="40.74" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:id="#+id/signupRow4"
android:layout_marginTop="5dp"
android:layout_below="#+id/signupRow3"
android:layout_height="wrap_content">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:ems="10"
android:background="#drawable/rounded_edit_text"
android:id="#+id/editTextPassword"
android:paddingLeft="5dp"
android:hint="Password"
android:fontFamily="sans-serif"
/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:id="#+id/signupRow5"
android:layout_marginTop="5dp"
android:layout_below="#+id/signupRow4"
android:layout_height="wrap_content">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:ems="10"
android:background="#drawable/rounded_edit_text"
android:id="#+id/editTextConfirmPass"
android:hint="Confirm Password"
android:paddingLeft="5dp"
android:fontFamily="sans-serif"
/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:id="#+id/signupRow6"
android:layout_marginTop="5dp"
android:layout_below="#+id/signupRow5"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Gender:"
android:id="#+id/textViewGender"
android:layout_gravity="left|top"
android:layout_weight="5.18" />
<Spinner
android:layout_width="129dp"
android:layout_height="30dp"
android:id="#+id/spinnerGender"
android:background="#606060"
android:layout_weight="2.84" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:id="#+id/signupRow7"
android:layout_marginTop="5dp"
android:layout_below="#+id/signupRow6"
android:layout_height="wrap_content"
android:baselineAligned="false">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Year of Birth:"
android:id="#+id/textViewyearOfBirth"
android:layout_weight="5.18" />
<Spinner
android:layout_width="129dp"
android:layout_height="30dp"
android:id="#+id/spinnerAge"
android:layout_marginLeft="10dp"
android:background="#606060"
android:layout_weight="3.14" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:id="#+id/signupRow8"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/imageViewGallery"
android:layout_below="#+id/rotateLayout"
android:layout_height="wrap_content">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Select Photo"
android:id="#+id/buttonSelectImg"
android:layout_marginTop="5dp"
android:background="#606060"
android:textColor="#ffffffff"
android:layout_marginLeft="5dp"
android:layout_margin="10dp"
android:layout_weight="1" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:id="#+id/signupRow9"
android:layout_below="#+id/signupRow8"
android:layout_height="wrap_content"
android:layout_toEndOf="#+id/imageViewGallery">
</TableRow>
<RelativeLayout
android:layout_height="wrap_content"
android:layout_width="123dp"
android:background="#606060"
android:layout_marginLeft="5dp"
android:id="#+id/rotateLayout"
android:layout_toRightOf="#+id/imageViewGallery">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageButtonRleftt"
android:background="#drawable/rotate_left"
android:layout_gravity="center"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageButtonRright"
android:background="#drawable/rotate_right"
android:onClick="rottateRight"
android:layout_gravity="center"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
<Button
android:id="#+id/ButtonSubmit"
android:text="Create Account"
android:layout_width="match_parent"
android:background="#606060"
android:textColor="#ffffffff"
android:layout_alignParentBottom="true"
android:layout_below="#+id/signupRow7"
android:layout_height="50dp"
android:layout_margin="5dp"
>
</Button>
</RelativeLayout>
Just set the width for both drawables to "wrap_content" and delete the weight attribute. Then add the gravity attribute to the table row like this:
<TableRow
android:layout_width="match_parent"
android:id="#+id/signupRow9"
android:layout_marginTop="5dp"
android:layout_below="#+id/signupRow8"
android:layout_height="wrap_content"
android:layout_toEndOf="#+id/imageViewGallery"
android:gravity="center">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageButtonRleftt"
android:src="#drawable/rotate_right"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageButtonRright"
android:src="#drawable/rotate_right"
android:onClick="rottateRight"/>
</TableRow>
The easiest way is to define a static height for you tablerow and then set the height attribute for your spinner and edittext to "match_parent". Another way is to get the height of your edittext programmatically and then set the height for the spinner at runtime. I would recommend the second method, because it looks better for different devices.
You're using the wrong attribute. Try it with android:layout_alignParentTop="true" to set the View to the top.
For the
1)use a single/separate table layout and add first row as "SELECT PHOTO" using colspan attribute and for the second row add the buttons using weight Attribute.
2)Instead of using warpcontent for both of them set layout_height="50dp" or anything, such that it's similar to other widgets in terms of height.
3)use CreateAccount widget directly without a tablerow with this attribute android:layout_alignParentTop="true" such that the parent of this widget is Relativelayout.
I want to create a listview like older gmail app. See the screenshot:
I tried putting an empty view like this:
<TextView
android:id="#+id/color_highlight"
android:layout_width="5dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="#ff0000"
android:minHeight="48dp" />
<TextView
android:id="#+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:layout_toLeftOf="#id/color_highlight"
android:text="Mudit Agarwal"
android:textStyle="bold"
android:textColor="#242424"
android:textIsSelectable="false"
android:textSize="22sp" />
<TextView
android:id="#+id/number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#id/name"
android:layout_below="#id/name"
android:text="9933445566"
android:textColor="#777777"
android:textIsSelectable="false"
android:layout_marginBottom="10dp"
android:textSize="15sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:padding="3dp"
android:src="#drawable/contact" />
but this is not taking full height of the view. Please suggest.
What I changed is
android:layout_alignBottom="#+id/number"
to your color_highlight TextView. and instead of margin, I put padding like below in number TextView.
android:paddingBottom="20dp"
just put following layout code.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/color_highlight"
android:layout_width="5dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_alignBottom="#+id/number"
android:background="#ff0000"
android:minHeight="48dp" />
<TextView
android:id="#+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:layout_toLeftOf="#id/color_highlight"
android:text="Mudit Agarwal"
android:textColor="#242424"
android:textIsSelectable="false"
android:textSize="22sp"
android:textStyle="bold" />
<TextView
android:id="#+id/number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#id/name"
android:layout_below="#id/name"
android:paddingBottom="20dp"
android:text="9933445566"
android:textColor="#777777"
android:textIsSelectable="false"
android:textSize="15sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:padding="3dp"
android:src="#drawable/contact" />
</RelativeLayout>
I'm not sure but you can try putting android:layout_height="0dip" instead of android:layout_height="match_parent".
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/relativelayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:padding="30dp" >
<
android:id="#+id/uconnecttitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
android:layout_marginBottom="5dp"
android:scaleType="centerInside"
android:src="#drawable/icon_logo_uconnect" />
<EditText
android:id="#+id/pwdfield"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/username"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:paddingLeft = "10dip"
android:background="#drawable/edittext_background"
android:hint="Password"
android:password="true"
android:textColor="#ffffff"
android:textColorHint="#d0d0d0"
android:textSize="24sp"
android:singleLine="true"
android:imeOptions="actionDone"
/>
<EditText
android:id="#+id/username"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/pwdfield"
android:layout_below="#+id/uconnecttitle"
android:layout_marginTop="10dp"
android:paddingLeft = "10dip"
android:background="#drawable/edittext_background"
android:hint="Username"
android:textColor="#ffffff"
android:textColorHint="#d0d0d0"
android:textSize="24sp"
android:singleLine="true">
</EditText>
<TextView
android:id="#+id/TextVersionNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="16dp"
android:textColor="#008000"
android:textSize="20sp"
android:text="#string/appVersionName"
android:visibility="gone"/>
<Button
android:id="#+id/loginbtn"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/pwdfield"
android:layout_below="#+id/pwdfield"
android:layout_marginTop="10dp"
android:background="#drawable/button_custom"
android:text="#string/loginButton"
android:textColor="#ffffff"
android:textSize="28sp"
/>
<TextView
android:id="#+id/UserAlert"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/pwdfield"
android:layout_below="#+id/username"
android:text="dfgfdgdfg"
android:textColor="#B0171F"
android:visibility="gone" />
<TextView
android:id="#+id/PwdAlert"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/loginbtn"
android:layout_below="#+id/pwdfield"
android:text="dsfsdf"
android:textColor="#B0171F"
android:visibility="gone" />
<TextView
android:id="#+id/troubleLoggingIn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/loginbtn"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="#string/troubleLoggingIn"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#0645AD" />
</RelativeLayout>
I need to push TextVersionNum down, I tried android:layout_marginBottom="0" but it does not bring the item down to the bottom. How can I move TextVersionNum as close to the bottom screen as possible? I also tried to set the padding for troubleLoggingIn, android:layout_marginBottom="0" but I do not see anything happen.
TextVersionNum might not be at the absolute bottom because if the container's padding:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/relativelayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:padding="30dp" >
Try to set padding of the relativeLayout only for the other margins (top, left and right).