I want to apply background image on Relativelayout Under ScrollView.
The Image Appear on XML View but Not Appear on Actual device.
I have added ImageView on Ralativelayout
>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:id="#+id/parentView"
>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="#drawable/cloudbg"
/>
<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:id="#+id/vo"
android:layout_below="#id/relativeLayout"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_height="wrap_content">
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="XYZ"
/>
<TextView
android:layout_width="wrap_content"
android:layout_marginLeft="25dp"
android:layout_height="wrap_content"
android:id="#+id/textvo"
android:text="Voter Number"
/>
</LinearLayout>
</RelativeLayout>
</ScrollView>
Thanks
can try this way:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/cloudbg">
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:id="#+id/vo"
android:layout_below="#id/relativeLayout"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_height="wrap_content">
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="XYZ"
/>
<TextView
android:layout_width="wrap_content"
android:layout_marginLeft="25dp"
android:layout_height="wrap_content"
android:id="#+id/textvo"
android:text="Voter Number"
/>
</LinearLayout>
</ScrollView>
Use android:background="#drawable/background_image" attribute in Relative or Linear Layout tag.
Set background for scrollview
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/ic_launcher" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>
Related
What I want is for qrcodetext to fit and display all the text in qrcode_layout and have qrimageView to fill the rest of qrcode_layout? But my layout below has the entire qrimageView cover qrcode_layout. I tried a bunch of other variations but without success.
Here is what it looks like.
Here is what I want it to look like.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical"
android:id="#+id/qrcodelayout">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/qrimageView"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/qrcodetext"
android:gravity="center"
android:layout_gravity="center_horizontal"
android:layout_marginTop="4dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</RelativeLayout>
Use following code. Align your textview to bottom and then align your Qrcode Image above text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/qrcodetext"
android:gravity="center"
android:layout_alignParentBottom="true"
android:layout_marginTop="4dp" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/qrimageView"
android:layout_gravity="center_horizontal"
android:layout_above="#id/qrcodetext"
android:layout_alignParentTop="true"
android:layout_marginTop="8dp" />
</RelativeLayout>
I think what i have understand you want is below: Plz check and tell me:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical"
android:id="#+id/qrcodelayout">
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="#+id/qrcodetext"
android:gravity="center"
android:layout_weight="1"
android:layout_gravity="center_horizontal"
android:layout_marginTop="4dp" />
<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_weight="1">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/qrimageView"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp" />
</LinearLayout>
</LinearLayout>
<!--<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>-->
</RelativeLayout>
I'm beginner in android and want show something with this plan:
and my xml file is this:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:id="#+id/drawer_layout"
android:layout_width="match_parent" android:layout_height="match_parent"
tools:context=".MainActivity">
<FrameLayout android:id="#+id/container" android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/ExplainImage"
android:layout_gravity="center"
android:layout_width="fill_parent"
android:layout_height="78dp"
android:src="#drawable/abc_btn_check_material" />
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="#+id/MAINLABEL"
android:layout_gravity="center" />
</ScrollView>
</FrameLayout>
</android.support.v4.widget.DrawerLayout>
but when run my app,i see like this:
How can i solve that problem?thanks.
i change XML file but so not work!,my complete xml file after change:
<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:id="#+id/drawer_layout"
android:layout_width="match_parent" android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout android:id="#+id/container" android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="3" >
<ImageView
android:id="#+id/ExplainImage"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:src="#drawable/abc_btn_check_material" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="2">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="#+id/MAINLABEL" />
</ScrollView>
</LinearLayout>
<ListView
android:id="#+id/myLIST"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<fragment android:id="#+id/navigation_drawer"
android:layout_width="#dimen/navigation_drawer_width" android:layout_height="match_parent"
android:layout_gravity="start"
android:name="com.example.nothing.myapplication.NavigationDrawerFragment"
tools:layout="#layout/fragment_navigation_drawer" />
</android.support.v4.widget.DrawerLayout>
The 1st figure is your requirement. So i will first answer what would be the best way to achieve your desired result. Using LinearLayout instead of FrameLayout would be recommended in this case. Then you should use layout_weight attribute for your ImageView and TextView along with layout_height="0dp". Note that TextView automatically scrolls vertically so you don't really need ScrollView.
Do something like this.
<ImageView
android:id="#+id/ExplainImage"
android:layout_gravity="center"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="0.3"
android:src="#drawable/abc_btn_check_material" />
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="#+id/MAINLABEL"
android:layout_weight="0.7"
android:layout_gravity="center" />
Refer this answer for a better understanding.
So finally you do something like this
<LinearLayout
android:id="#+id/lin_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:weightSum="4"
android:orientation="vertical" >
<ImageView
android:id="#+id/ExplainImage"
android:layout_gravity="center"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:src="#drawable/abc_btn_check_material">
</ImageView>
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="#+id/MAINLABEL"
android:layout_weight="3"
android:layout_gravity="center" />
</LinearLayout>
However if your TextView doesn't scroll automatically , use ScrollView as mentioned in other answers by setting layout_weight and layout_height attributes.
Replace xml file with this:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:id="#+id/container"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent">
<ImageView
android:id="#+id/ExplainImage"
android:layout_gravity="center"
background="color_code"
android:layout_weight="0.3"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:src="#drawable/abc_btn_check_material" />
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="0.7">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="#+id/MAINLABEL"
android:layout_gravity="center" />
</ScrollView>
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
You can use a LinearLayout with weights:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:id="#+id/drawer_layout"
android:layout_width="match_parent" android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout android:id="#+id/container" android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="3" >
<ImageView
android:id="#+id/ExplainImage"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:src="#drawable/abc_btn_check_material" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="2">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="#+id/MAINLABEL" />
</ScrollView>
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
Try this :
<LinearLayout
android:id="#+id/ll"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:weightSum="5"
android:orientation="vertical" >
<ImageView
android:layout_height="0dp"
android:layout_width="fill_parent"
android:layout_weight="1.5">
</ImageView>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="3.5"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="#+id/MAINLABEL"
android:layout_gravity="center" />
</ScrollView>
</LinearLayout>
You can try this one as I am able to get proper output as you needed.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:weightSum="1">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:background="#color/blue">
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="#drawable/ic_launcher" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.7"
android:background="#color/orange">
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text="TestView" />
</LinearLayout>
I have two view in a vertical orientated LinearLayout like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/top"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:text="dddd"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</RelativeLayout>
<RelativeLayout
android:id="#+id/below"
android:layout_below="#id/top"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:background="#33000000"
android:textColor="#80000000"
android:id="#+id/copy_right"
android:text="Copyright #2013"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
</LinearLayout>
While I want the bottom view with a wrap_content height, then the top take all the left space.
But it does not work.
What's the problem? Anyone can help me to fix it?
BTW, this is an alternative method:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<Button
android:text="dddd"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</RelativeLayout>
<RelativeLayout
android:id="#+id/below"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_weight="0">
<TextView
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:background="#33000000"
android:textColor="#80000000"
android:id="#+id/copy_right"
android:text="Copyright #2013"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
</LinearLayout>
It meet my requirement, but I do not want make the bottom view with a fixed height.
Try this simplified layout:
<?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="match_parent"
>
<TextView
android:id="#+id/copy_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:background="#33000000"
android:textColor="#80000000"
android:text="Copyright #2013"
/>
<RelativeLayout
android:id="#+id/top"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#id/copy_right"
android:layout_alignParentTop="true"
>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="dddd"
/>
</RelativeLayout>
</RelativeLayout>
Hi you can set weight on top layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/top"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" >
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top|center_horizontal"
android:text="dddd"
android:textColor="#000" />
</RelativeLayout>
<LinearLayout
android:id="#+id/below"
android:layout_width="match_parent"
android:gravity="right"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/copy_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#33000000"
android:text="Copyright #2013"
android:textColor="#80000000" />
</LinearLayout>
</LinearLayout>
I have used LinearLayout in my activity, in that I need to display another LinearLayout containing image to be displayed at the bottom.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/relativeLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="#drawable/gamelevelscreen"
android:orientation="vertical" >
.......
<LinearLayout
android:id="#+id/linearLayout_AdMob"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="bottom"
android:layout_alignParentBottom="true"
android:gravity="center">
</LinearLayout>
</LinearLayout>
But the image is not completely aligned at the bottom. Its a little above the bottom.
I have completed the layout designing and it will be a lot of rework to make it Relative now. Kindly give solution to make it happen in LinearLayout only.
Use Relative layout instead of Linear layout or use Weight for doing this in Linear layout.
Try this it will surely help you.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:id="#+id/linearLayout_AdMob"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center"
android:orientation="horizontal" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_launcher" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/relativeLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/linearLayout_AdMob"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center"
android:orientation="horizontal" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_launcher" />
</LinearLayout>
</RelativeLayout>
Try this..
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/gamelevelscreen"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/linearLayout_AdMob"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:layout_alignParentBottom="true">
</LinearLayout>
</RelativeLayout>
// try this
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="5dp"
android:orientation="vertical" >
<LinearLayout
android:layout_height="0dp"
android:layout_width="match_parent"
android:layout_weight="1">
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout_AdMob"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center">
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:adjustViewBounds="true"
android:src="#drawable/ic_launcher"/>
</LinearLayout>
</LinearLayout>
I have some Image Button on AbsoluteLayout, because they need to be placed on some parts on the ImageView.
I want that when I change the screen size resolution, the Image Buttons will stay at the exactly location on the ImageView.
The problem is that if I change the resolution, all the Image Buttons are moving from their places.
Maybe there is a way to place the Image Button without AbsoluteLayout on base of
ratio or percentage from the ImageView, because I know that AbsoluteLayout is not recommanded at all.
Thank you for the help
This is my xml code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
tools:context=".G" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toLeftOf="#+id/ScrollView1"
android:orientation="horizontal"
android:weightSum="100" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="15"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toLeftOf="#+id/ScrollView1"
android:orientation="vertical"
android:weightSum="100" >
<AbsoluteLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_weight="20"
android:layout_alignParentTop="true"
android:layout_toLeftOf="#+id/ScrollView1" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/tvOn"
android:layout_alignParentTop="true"
android:scaleType="fitXY"
android:src="#drawable/t" />
<ImageButton
android:id="#+id/bon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="319dp"
android:layout_y="88dp"
android:src="#drawable/b_blue" />
<ImageButton
android:id="#+id/bo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="287dp"
android:layout_y="125dp"
android:src="#drawable/b_blue" />
</AbsoluteLayout>
<TextView
android:id="#+id/tvOn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_weight="80" />
</LinearLayout>
</LinearLayout>
<ScrollView
android:id="#+id/ScrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_weight="85"
android:scrollbars="vertical" >
<LinearLayout
android:id="#+id/rGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:orientation="vertical" >
<ToggleButton
android:id="#+id/bmD"
android:layout_width="match_parent"
android:layout_height="60dp" />
<ToggleButton
android:id="#+id/bmCt"
android:layout_width="match_parent"
android:layout_height="60dp"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
</RelativeLayout>