Resize scrollview only in android - java

I have an android layout made like this:
--------------
| IMAGE1 |
--------------
| SCROLLVIEW |
--------------
| IMAGE2 |
--------------
When the keyboard pops up to input text in the scrollview's edittext, it resizes the whole application. Is there any way to keep IMAGE2 at the bottom of the screen?
The layout of the application:
<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="0dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".SignupActivity" >
<ImageView
android:id="#+id/Logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="26dp"
android:src="#drawable/logo_1" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:scaleType="centerCrop"
android:src="#drawable/wave_2" />
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_below="#+id/Logo" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="286dp"
android:fadingEdge="none"
android:orientation="vertical"
android:paddingBottom="30dp" >
<EditText
android:id="#+id/editName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:ems="10"
android:hint="#string/name" />
<EditText
android:id="#+id/editSurname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:ems="10"
android:hint="#string/surname" />
<EditText
android:id="#+id/editCompany"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:ems="10"
android:hint="#string/company" />
<Space
android:layout_width="match_parent"
android:layout_height="20dp" />
<EditText
android:id="#+id/editUsername"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:ems="10"
android:hint="#string/username" />
<EditText
android:id="#+id/editPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:ems="10"
android:hint="#string/password"
android:inputType="textPassword" />
<EditText
android:id="#+id/editMail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:ems="10"
android:hint="#string/mail"
android:inputType="textEmailAddress" />
<Space
android:layout_width="match_parent"
android:layout_height="20dp" />
<EditText
android:id="#+id/editAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:ems="10"
android:hint="#string/address" />
<EditText
android:id="#+id/editZipCode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:ems="10"
android:hint="#string/zipcode" />
<EditText
android:id="#+id/editCity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:ems="10"
android:hint="#string/city" />
<EditText
android:id="#+id/editCountry"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:ems="10"
android:hint="#string/country" />
<EditText
android:id="#+id/editPhone1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:ems="10"
android:hint="#string/phone" />
<EditText
android:id="#+id/editPhone2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:ems="10"
android:hint="#string/mobilephone" />
<Space
android:layout_width="match_parent"
android:layout_height="20dp" />
<Button
android:id="#+id/acceptButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="signup"
android:layout_gravity="center_horizontal"
android:text="#string/register" />
</LinearLayout>
</ScrollView>
</RelativeLayout>
Edit:
This is how actually the layout is. I want to keep the green wave image at the end of the page (under the keyboard) while still resizing the ScrollView to make it usable.
http://i.stack.imgur.com/ji1FB.png
http://i.stack.imgur.com/D4jcX.png

add this lines in your manifest in activity tag may be this works
<activity
android:name=".DemoActivity"
android:windowSoftInputMode="stateHidden|adjustResize" >
</activity>

If you want your IMAGE2 stuck at the bottom of the screen, put below code inside your activity tag in manifest.xml
<activity
.
.
android:windowSoftInputMode="adjustPan" >
</activity>
EDIT:
Try to put below tag along with the above mentioned one
android:windowSoftInputMode="stateVisible|adjustResize"
Let me know if this one works for you.

The problem is that your Button is part of the ScrollView. You should pull your Button out of the ScrollView and into the parent RelativeLayout, changing the attributes as follows:
<Button
android:id="#+id/acceptButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" //keep it to the bottom of the layout
android:onClick="signup"
android:layout_gravity="center_horizontal"
android:text="#string/register" />
Then your ScrollView will also need a modification:
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_below="#+id/Logo"
android:layout_above="#+id/acceptButton" //make it stay above the button
>
And given that you are using android:windowSoftInputMode="adjustResize", this should give you the correct behavior.
EDIT: Wait, if you just want the background to stay positioned, try just setting that image as your windowBackground in your Activity theme. (e.g. add android:windowBackground="#drawable/my_background_image" to the theme that your Activity uses).

Related

Align views in a relative layout to the bottom of the screen

I am trying to align a text area with username and phone along with a button to the bottom of the screen by adding margin-top on id with
android:id="#+id/textView1"
attribute but no effect as shown in the following snippet
<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"
>
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView2"
android:layout_centerHorizontal="true"
android:src="#drawable/ic_launcher"
/>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/phone"
android:layout_centerVertical="true"
android:text="Username"
/>
<EditText
android:id="#+id/username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_below="#+id/textView1"
android:ems="10" />
<TextView
android:id="#+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/username"
android:layout_below="#+id/username"
android:text="Phone No" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentTop="true"
android:layout_marginTop="16dp"
android:gravity="center"
android:text=" User Registration"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold" />
<EditText
android:id="#+id/phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/TextView01"
android:layout_centerHorizontal="true"
android:ems="10"/>
<Button
android:id="#+id/register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/phone"
android:layout_below="#+id/phone"
android:text="Register" />
</RelativeLayout>
The screen below shows the output
I want from the username textview down to the register button to be align to the bottom of the screen. I have tried adding margin but did not work
Did you try to use a relative layout.
If you have a relative layout that fills the whole screen you should be able to use android:layout_alignParentBottom to move the button to the bottom of the screen.

Android studio setting layout up like this

I've tried everything I can think of but can't get this layout working. It's a ListView that list matches in a row.
Row one is first match, and next row is second match, and so on. I don't don't mind the green strokes and borders.
Is it even possible?
See the deisgn here:
Here's an example implementation, it does however use negative margins, to overlap the thing I called badge.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#cdcdcd"
android:gravity="center_vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="#+id/score"
android:layout_below="#+id/badge"
android:background="#color/white"
android:orientation="vertical"
android:padding="16dp"
android:showDividers="middle">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView 1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView 2"/>
</LinearLayout>
<TextView
android:id="#+id/score"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:padding="16dp"
android:text="0 vs 7"
android:layout_below="#+id/badge"
android:textSize="32sp"
android:textStyle="bold"/>
<LinearLayout
android:layout_below="#+id/badge"
android:id="#+id/right_table"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/score"
android:background="#color/white"
android:orientation="vertical"
android:padding="16dp"
android:showDividers="middle">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView 1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView 2"/>
</LinearLayout>
<TextView
android:id="#+id/badge"
android:layout_toRightOf="#id/score"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#0f0"
android:layout_marginLeft="-12dp"
android:layout_marginBottom="-8dp"
android:text="Badge"
/>
</RelativeLayout>
To alternate the background simply set the background in getView in your adapter.
You'll need a custom adapter that fills the ListView (better use RecyclerView & an Adapter with ViehHolder), this row layout is taken from my own project, not exactly what you requested, but you'll get the idea. Just comment for further information.
<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="wrap_content"
>
<TextView
android:id="#+id/textV_player1"
android:text="player1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="40dp"
android:layout_marginEnd="40dp"
android:textSize="20sp"
android:paddingTop="15dp"
android:gravity="end"
android:layout_alignParentTop="true"
android:layout_toLeftOf="#+id/textV_vs"
android:layout_toStartOf="#+id/textV_vs" />
<TextView
android:id="#+id/textV_player2"
android:text="player2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:paddingTop="15dp"
android:layout_alignBottom="#+id/textV_vs"
android:layout_toRightOf="#+id/textV_vs"
android:layout_toEndOf="#+id/textV_vs" />
<TextView
android:id="#+id/textV_vs"
android:text="vs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="40dp"
android:layout_marginEnd="40dp"
android:textSize="20sp"
android:layout_above="#+id/textV_points1"
android:layout_centerHorizontal="true" />
<TextView
android:id="#+id/textV_points1"
android:text="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:paddingTop="3dp"
android:paddingBottom="15dp"
android:layout_below="#+id/textV_player1"
android:layout_alignRight="#+id/textV_player1"
android:layout_alignEnd="#+id/textV_player1" />
<TextView
android:id="#+id/textV_points2"
android:text="2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:paddingTop="3dp"
android:paddingBottom="15dp"
android:layout_below="#+id/textV_player2"
android:layout_alignLeft="#+id/textV_player2"
android:layout_alignStart="#+id/textV_player2" />
<TextView
android:id="#+id/textV_vspoints"
android:text=":"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:paddingBottom="15dp"
android:layout_below="#id/textV_vs"
android:layout_centerHorizontal="true" />
</RelativeLayout>

TextView not showing full text in Relative Layout

I want to change text of Textview dynamically,
but it does not show full text.instead it shw one or two character less than it or sometimes show "...." atlast.
This is a layout for an custom equalizer.
This is my xml file.
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="#+id/fullscreenlnearlayout"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="0.38"
android:gravity="center" >
<Button
android:id="#+id/btnformenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:text="Create New..." />
<ImageButton
android:id="#+id/refresh"
android:contentDescription="Reset Equalizer to Default"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_margin="20dp"
android:adjustViewBounds="false"
android:alpha=".4"
android:src="#drawable/refresh"
android:layout_marginTop="10dp"
android:textAppearance="?android:attr/textAppearanceLarge" />
<ToggleButton
android:id="#+id/exit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignTop="#+id/refresh"
android:layout_marginRight="15dp"
android:layout_marginEnd="15dp"
android:alpha=".4" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:id="#+id/horizontalscrollforequaliser"
android:layout_height="0dp"
android:isScrollContainer="false"
android:layout_weight="1">
<TextView
android:id="#+id/seekbar1kabottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:text="60Hz" />
<include
android:id="#+id/include5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/seekbar1kabottom"
android:layout_alignTop="#+id/include7"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_centerHorizontal="true"
layout="#layout/eq_bar" />
<TextView
android:id="#+id/seekbar3katop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:singleLine="true"
android:text="0mB" />
<TextView
android:id="#+id/seekbar3kabottom"
android:singleLine="true"
android:layout_width="wrap_content"
android:layout_centerInParent="true"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:text="910Hz" />
<include
android:id="#+id/include7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/seekbar3kabottom"
android:layout_alignParentLeft="true"
android:layout_below="#+id/seekbar3katop"
layout="#layout/eq_bar" />
<include
android:id="#+id/include"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/seekbar5kabottom"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/include4"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginStart="10dp"
layout="#layout/eq_bar" />
<include
android:id="#+id/include4"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/include5"
android:layout_alignTop="#+id/include6"
android:layout_toStartOf="#+id/include"
android:layout_toLeftOf="#+id/include"
layout="#layout/eq_bar" />
<TextView
android:id="#+id/seekbar4katop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/include4"
android:layout_alignStart="#+id/include4"
android:layout_alignEnd="#+id/seekbar4kabottom"
android:layout_alignLeft="#+id/include4"
android:layout_alignRight="#+id/seekbar4kabottom"
android:singleLine="false"
android:text="0mB"/>
<TextView
android:id="#+id/seekbar5kabottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:singleLine="true"
android:layout_below="#+id/include4"
android:text="14KHz" />
<TextView
android:id="#+id/seekbar4kabottom"
android:singleLine="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/include4"
android:layout_alignLeft="#+id/include4"
android:layout_below="#+id/include4"
android:text="3600Hz" />
<TextView
android:id="#+id/seekbar2kabottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/include6"
android:layout_alignParentBottom="true"
android:singleLine="true"
android:text="230Hz" />
<TextView
android:id="#+id/seekbar2katop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/include6"
android:layout_alignEnd="#+id/seekbar2kabottom"
android:layout_alignLeft="#+id/include6"
android:layout_alignParentTop="true"
android:layout_alignRight="#+id/seekbar2kabottom"
android:singleLine="false"
android:text="0mB" />
<include
android:id="#+id/include6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/include7"
android:layout_below="#+id/seekbar1katop"
android:layout_marginStart="15dp"
android:layout_marginLeft="15dp"
android:layout_toRightOf="#+id/include7"
layout="#layout/eq_bar" />
<TextView
android:id="#+id/seekbar5katop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/include"
android:layout_alignLeft="#+id/seekbar5kabottom"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_alignStart="#+id/include"
android:singleLine="false"
android:text="0mB" />
<TextView
android:id="#+id/seekbar1katop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/include7"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignRight="#+id/include7"
android:singleLine="false"
android:text="0mB" />
</RelativeLayout>
</LinearLayout>
In picture you can see text s not coming u fully....it is not showing mB (unit) atlast.
I am trying this from several hours,but unable to do this
Please give me a way to achieve this .
Thans in advance :)
You can decrease the text size of the TextView and see the changes. Ideally Android design guidelines specify that you create separate layouts for different screen sizes and resolutions. So on some devices the TextView font size would just fit fine but for others it'd have to be adjusted
You can decrease Text size of the TextView .
If you want remove .... You can remove this line
android:singleLine="true"
and set width as match_parent or fill_parent .
Remove wrap content and set a size using dp, it will probably work

Displaying Button Above Image in Android

I am making an android application in which i have an ImageView and an Forward Arrow Button ,All i want is to display the button at the Right Center of the screen above the image.
Here is my code.....
<ImageView
android:id="#+id/ImageShow"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<EditText
android:id="#+id/postal_address"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/postal_address_hint"
android:inputType="textPostalAddress" />
Maybe you can try something like this:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="#+id/ImageShow"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="#+id/YOUR_BUTTON_ID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#id/ImageShow" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_alignParentRight="true"
/>
</RelativeLayout>

How to position a button in android XML?

Hey I have the code bellow for my buttons in XML and I would like the Anthem Button to be moved to the left hand side near the bottom corner and I will add a stop button in the bottom right, Could anyone advise me on how to do this?
XML:
<?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"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="#string/country1"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="45sp" />
<ImageView
android:id="#+id/ivFlag1"
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="55dp"
android:src="#drawable/sflag" />
<Button
android:id="#+id/bEdinburgh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/ivFlag1"
android:layout_centerHorizontal="true"
android:layout_marginTop="29dp"
android:gravity="center"
android:text="#string/Edinburgh"
android:textSize="20sp" />
<Button
android:id="#+id/bGlasgow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/bEdinburgh"
android:layout_centerHorizontal="true"
android:layout_marginTop="29dp"
android:gravity="center"
android:text="#string/Glasgow"
android:textSize="20sp" />
<Button
android:id="#+id/bAberdeen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/bGlasgow"
android:layout_centerHorizontal="true"
android:layout_marginTop="29dp"
android:gravity="center"
android:text="#string/Aberdeen"
android:textSize="20sp" />
<Button
android:id="#+id/bAnthem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/bAberdeen"
android:layout_centerHorizontal="true"
android:layout_marginTop="29dp"
android:background="#drawable/custom"
android:textSize="20sp" />
Set following attributes in the Anthem button
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
and following to the Stop button
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
In your Anthem Button, set android:layout_alignParentLeft or android:layout_alignParentRight to true will do the trick.

Categories