How to set button under very large WebView on Android? - android

I have problem with setting button under large muptipage webview (User Agreement). Now I can see the button all the time while scrolling webview.
When I add android:layout_below="#+id/rl_relativeLayoutto button in layout, I can see only WebView content.
<?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"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/rl_relativeLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="10dip" >
<WebView
android:id="#+id/web_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
/>
</RelativeLayout>
<RelativeLayout
android:id="#+id/rl_relativeLayout2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center_horizontal"
android:layout_margin="10dip" >
<Button
android:id="#+id/agreement_acceptance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="3dp"
android:text="OK" />
</RelativeLayout>

Use ScrollView
<ScrollView android:layout_height="fill_parent"
android:layout_width="fill_parent">
<LinearLayout android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<WebView android:layout_height="wrap_content"
android:layout_width="fill_parent"/>
<Button android:layout_height="wrap_content"
android:layout_width="fill_parent"/>
</LinearLayout>
</ScrollView>

just add webView above the button and the button align to bottom ;)
In your case something like that
<?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"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/rl_relativeLayout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="10dip"
android:layout_alignParentBottom="true" >
<Button
android:id="#+id/agreement_acceptance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="3dp"
android:text="OK" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rl_relativeLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="10dip"
android:layout_above="#+id/rl_relativeLayout2"
>
<WebView
android:id="#+id/web_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
/>
</RelativeLayout>

Just replace this.
<?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"
android:orientation="vertical" >
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/agreement_acceptance"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/rl_relativeLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dip" >
<WebView
android:id="#+id/web_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
<Button
android:id="#+id/agreement_acceptance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="OK" />

Related

How display a LinearLayout above a FrameLayout?

My code XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#777777"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dip"
android:layout_alignParentTop="true"
android:gravity="left|bottom"
android:orientation="horizontal" >
<TextView
android:id="#+id/txtTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="00:00:00"
android:textColor="#ffffff" />
</LinearLayout>
<FrameLayout
android:id="#+id/camera_preview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="110dp"
android:background="#000000" >
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_alignParentBottom="true"
android:gravity="center|top"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center"
android:orientation="horizontal" >
<Button
android:id="#+id/button_Rotation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#drawable/my_progress_interminate" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
How display TextView txtTime above FrameLayout the same button button_Rotation?
I had fixed by move layout contain TextView down to under Framelayout:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#777777"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<FrameLayout
android:id="#+id/camera_preview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="110dp"
android:background="#000000" >
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dip"
android:layout_alignParentTop="true"
android:gravity="left|bottom"
android:orientation="horizontal" >
<TextView
android:id="#+id/txtTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="00:00:00"
android:textColor="#ffffff" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_alignParentBottom="true"
android:gravity="center|top"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center"
android:orientation="horizontal" >
<Button
android:id="#+id/button_Rotation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#drawable/my_progress_interminate" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
outter linearLayout unless, then in your RelativeLayout
1st RelativeLayou: android:layout_alignParentTop="true", and set an id(#+id/rl)
2nd FrameLayout: android:layout_below="#id/rl"
3rd LinearLayout: android:layout_below="#id/camera_view"
That's all! Good luck!
It is the easiest way to do it:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout
android:id="#+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FAFFD5" >
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_alignParentBottom="true"
android:gravity="center"
android:orientation="vertical"
android:background="#drawable/textlayout_outline"
android:layout_margin="50dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/are_you_looking_for_something" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/tap_here" />
</LinearLayout>

Android VideoView Black bar appearing at bottom

I have a videoview to play a video and after that some other buttons in that layout.But the black bar of the video is appearing on bottom of layout.What i should do to make the blackbar on videoview's bottom.
<?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"
android:background="#color/White" >
<RelativeLayout
android:id="#+id/first_intro"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="10dp"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp"
android:layout_marginTop="14dp"
android:background="#color/intro2_bg"
android:padding="#dimen/sidearea_padding" >
<Button
android:id="#+id/remove_page_from_introthird"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_alignParentRight="true"
android:layout_marginTop="5dp"
android:background="#drawable/cross" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_above="#+id/footer_btns_layout_linear"
android:layout_centerInParent="true"
android:layout_marginBottom="20dp" >
<VideoView
android:id="#+id/videoView_introthree"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_gravity="center_vertical"
android:background="#android:color/transparent" />
</LinearLayout>
<LinearLayout
android:id="#+id/footer_btns_layout_linear"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:weightSum="1" >
<Button
android:id="#+id/prev_btn2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginRight="8dp"
android:layout_weight="0.5"
android:background="#drawable/previous_selecter" />
<Button
android:id="#+id/nxt_btn2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="8dp"
android:layout_weight="0.5"
android:background="#drawable/get_start_selecter" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
Try this :
<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" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
android:padding="5dip" >
<Button
android:id="#+id/mSDCardbutton"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:text="#string/play_sdcard" />
<Button
android:id="#+id/mServerbutton"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:text="#string/play_server" />
<Button
android:id="#+id/mRawbutton"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:text="#string/play_raw" />
</LinearLayout>
<Button
android:id="#+id/mbutton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/button" />
<VideoView
android:id="#+id/VideoView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
</LinearLayout>
In this layout, buttons are at top.You can keep it at bottom.
Hope this helps.

Intro layout problems with weight

I am creating an intro activity and What I want is that logo was double bigger than text, and the text was centered to the layout.
With the next code I am having problems with diferents layouts (in some screens the TextView is not shown:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/main_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1" >
<ImageView
android:id="#+id/image_intro"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#string/image_view_desc"
android:scaleType="fitCenter"
android:src="#drawable/iconok" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_weight="1" >
<TextView
android:id="#+id/email_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="55sp"
android:text="#string/loading_text3" />
</LinearLayout>
</LinearLayout>
What I am doing wrong?
As per your question and comments, I think below snippet will help you.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/main_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:orientation="vertical" >
<ImageView
android:id="#+id/image_intro"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="66"
android:scaleType="fitCenter"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/email_textview"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:gravity="left|center"
android:layout_weight="33"
android:text="#string/app_name"
android:textSize="55sp" />
</LinearLayout>
(After your comment) then you should set first inner linear layout's weight 2, and second's 1. Also use layout_height =" 0" for them.
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="2" >
<ImageView
android:id="#+id/image_intro"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#string/image_view_desc"
android:scaleType="fitCenter"
android:src="#drawable/iconok" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:gravity="center"
android:layout_weight="1" >
<TextView
android:id="#+id/email_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="55sp"
android:text="#string/loading_text3" />
</LinearLayout>
test this code :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/main_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:orientation="vertical"
android:weightSum="1.0" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.66" >
<ImageView
android:id="#+id/image_intro"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#string/image_view_desc"
android:scaleType="fitCenter"
android:src="#drawable/ic_launcher" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_weight="0.34" >
<TextView
android:id="#+id/email_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="55sp"
android:text="#string/loading_text3" />
</LinearLayout>
</LinearLayout>
// try this
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:weightSum="3"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:gravity="center"
android:layout_weight="2" >
<ImageView
android:id="#+id/image_intro"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="#stringimage_view_desc"
android:scaleType="fitXY"
android:adjustViewBounds="true"
android:src="#drawable/image_view_desc" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:gravity="center"
android:layout_weight="1" >
<TextView
android:id="#+id/email_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="55sp"
android:text="#stringloading_text3" />
</LinearLayout>
</LinearLayout>
Try this and change margin according to your requirement.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/main_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:orientation="vertical"
android:weightSum="3" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="2" >
<ImageView
android:id="#+id/image_intro"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:contentDescription=""
android:src="#drawable/ic_launcher" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_horizontal" >
<TextView
android:id="#+id/email_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="abcd"
android:textSize="55sp" />
</LinearLayout>

background textview half screen

I need set a textview (with its background) that fill half screen of device with fixed size of background. I try this code but I can't. The goal is: half screen, up I show image, down a textview.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000"
android:orientation="vertical" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/luna"
android:textSize="15pt" />
<ScrollView
android:id="#+id/scrollView10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#000000" >
<TextView
android:id="#+id/textView10"
android:layout_width="match_parent"
android:layout_height="320dp"
android:background="#000000"
android:gravity="center"
android:textColor="#ffffff"
android:textSize="14sp"
android:text="jjkjkljkjkldjklsdfjkljklsdfjklsdfjklsdfjklsdfjklsdfjklsdfjklfjlsdfjkl"
android:autoLink="web|email"
android:textStyle="italic" />
</ScrollView>
</LinearLayout>
<Button
android:id="#+id/button10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Chiudi" />
</LinearLayout>
you can achieve this by adding weights.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000"
android:orientation="vertical" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/luna"
android:textSize="15pt"
android:layout_weight="1"/>
<ScrollView
android:id="#+id/scrollView10"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:background="#000000"
android:layout_weight="1" >
<TextView
android:id="#+id/textView10"
android:layout_width="match_parent"
android:layout_height="320dp"
android:background="#000000"
android:gravity="center"
android:textColor="#ffffff"
android:textSize="14sp"
android:text="jjkjkljkjkldjklsdfjkljklsdfjklsdfjklsdfjklsdfjklsdfjklsdfjklfjlsdfjkl"
android:autoLink="web|email"
android:textStyle="italic" />
</ScrollView>
</LinearLayout>
<Button
android:id="#+id/button10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Chiudi" />
</LinearLayout>
Check this:
I have changed the inner linear layout to relative layout. I think it will give result as you want:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000"
android:orientation="vertical" >
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<ScrollView
android:id="#+id/scrollView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="center"
android:background="#000000" >
<TextView
android:id="#+id/textView10"
android:layout_width="match_parent"
android:layout_height="320dp"
android:autoLink="web|email"
android:background="#000000"
android:gravity="center"
android:text="jjkjkljkjkldjklsdfjkljklsdfjklsdfjklsdfjklsdfjklsdfjklsdfjklfjlsdfjkl"
android:textColor="#ffffff"
android:textSize="14sp"
android:textStyle="italic" />
</ScrollView>
<ImageView
android:id="#+id/img"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="#id/scrollView10"
android:background="#drawable/luna"
android:textSize="15pt" />
</RelativeLayout>
<Button
android:id="#+id/button10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Chiudi" />
</LinearLayout>
I have defined scrollview first. And then I defined ImageView with match_parent sizes. So it takes up all remaining space of screen. This way, image proportion will also be proper. Hope it helps.

[android]how to get 4 buttons at the bottom and each 2 button is beside each other

I find majority teaching online is about 2 button beside each other but I couldnt obtain the arrangement wanted as in the image. When I put in the relativelayout, all the button overlap together no matter I put android:layout_above:"XX" All my total, 0.00, back and pay button , i need to out them at the bottom. this is my original code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/billTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="bottom"
android:orientation="horizontal" >
<Button
android:id="#+id/backB"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Back" />
<Button
android:id="#+id/payB"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Pay" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/billTV"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.55"
android:text="TextView" />
<TextView
android:id="#+id/total"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="TextView" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:orientation="horizontal" >
<Button
android:id="#+id/backB"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Back" />
<Button
android:id="#+id/payB"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Pay" />
</LinearLayout>
</LinearLayout>
Try some thing like this.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="#+id/billTV"
android:layout_width="fill_parent"
android:layout_height="394dp"
android:text="TextView" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="#+id/total"
android:layout_width="fill_parent"
android:layout_height="32dp"
android:text="TextView" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical" >
<Button
android:id="#+id/backB"
android:layout_width="106dp"
android:layout_height="wrap_content"
android:text="Back" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="right"
android:orientation="vertical" >
<Button
android:id="#+id/payB"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Pay" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
try this

Categories

Resources