Android App mit Tabwidget

  • 3 Antworten
  • Letztes Antwortdatum
A

androidugs

Neues Mitglied
0
Hallo ich möchte folgenden AppAufbau. Eine Basis activity die immer läuft wo ich ein paar buttons drauf hab die auf der rechten seite immer sichtbar sind. Links davon sollen Tabs dargestellt werden, am besten für jeden Tab eine Activity wobei dies nicht zwingend notwendig ist. folgendermaßen sieht meine .xml datei aus:

HTML:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/tableLayout1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_gravity="top|left"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:screenOrientation="landscape"
    tools:context=".MainActivity" >

    <TableRow>

        <android.support.v4.app.FragmentTabHost
            android:id="@android:id/tabhost"
            android:layout_width="match_parent"
            android:layout_height="match_parent" 
            android:layout_weight="1" >

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical" >

                <TabWidget
                    android:id="@android:id/tabs"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="0"
                    android:orientation="horizontal" />

                <FrameLayout
                    android:id="@android:id/tabcontent"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_weight="0" />

                <FrameLayout
                    android:id="@+id/realtabcontent"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_weight="1" />
            </LinearLayout>
        </android.support.v4.app.FragmentTabHost>        

        <RelativeLayout>

           

            <Button
                android:id="@+id/continue_button"
                android:layout_width="150dp"
                android:layout_height="150dp"
                android:layout_alignParentLeft="true"
                android:layout_marginTop="27dp"                
                android:text="@string/continue" />

            <Button
                android:id="@+id/stop_button"
                android:layout_width="150dp"
                android:layout_height="150dp"
                android:layout_alignBaseline="@+id/continue_button"
                android:layout_alignBottom="@+id/continue_button"
                android:layout_alignParentRight="true"
                android:onClick="Stop"
                android:text="@string/stop" />

           
        </RelativeLayout>
    </TableRow>

</TableLayout>
Wie muss ich hierfür nun meine mainActivity aufbauen, welche von FragmentActivity erben soll?

PHP:
public class MainActivity extends FragmentActivity implements IUpdateable, OnSeekBarChangeListener {
    private static final String TAG = MainActivity.class.getSimpleName();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        final FragmentTabHost mTabHost;
        super.onCreate(savedInstanceState);  

    //was kommt hier hin? ... sprich wie erstelle ich die tabs und zeige sie an?
Vielen Dank für eure Hilfe.
 
Hi hat niemand ne idee?

gruß Androidugs
 
?
 
Hast du dich mal über Fragmente bei android dev eingelesen?

lg. Dagobert
 

Ähnliche Themen

K
Antworten
3
Aufrufe
960
mezzothunder
mezzothunder
M
Antworten
21
Aufrufe
1.285
swa00
swa00
Mr-Fisch
Antworten
5
Aufrufe
939
migi01
migi01
Mr-Fisch
Antworten
8
Aufrufe
986
Mr-Fisch
Mr-Fisch
M
Antworten
9
Aufrufe
769
mkuz24
M
Zurück
Oben Unten