• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Newbie Layout problem

techcent

Lurker
Hi Friends
I decided to work with a tab layout application. Program consist of 3 tabs and a button. I like to place the button below the tab. But it appears with tabs. I am placing code what i use, please give me a solution to resolve this problem

main.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
 <TabHost android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:id="@android:id/tabhost"
  xmlns:android="http://schemas.android.com/apk/res/android"
  >
  <TabWidget
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:id="@android:id/tabs"
  />
  <FrameLayout
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:id="@android:id/tabcontent"
   android:layout_alignParentBottom="true"
   >
    <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/content"
    android:orientation="vertical"
    android:paddingTop="60px"
    />
    <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true"></Button>
  </FrameLayout>
 </TabHost>

also find attachment of the application screen

thanks in advance :confused:
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    14.5 KB · Views: 72
I'm new to all this so I may be wrong, but it looks like you've closed the linear layout before adding the button. Try encapsulating the button inside the linear layout.

Is the button going to be present on all pages? If so I can see why you've done it like this, but it might be worth adding it to the layout of each of the pages at the top?

Food for thought anyway :)
 
Back
Top Bottom