簡體   English   中英

Android中的底部欄具有以上不同的布局?

[英]Bottom bar in Android with different layout above?

我想在Android中有一個共同的底線。 如果單擊了任何按鈕,則它將打開新活動,但底部欄仍在底部。 有什么辦法可以做到這一點? 我嘗試過在底部具有4個按鈕的超類,然后在click事件上打開新活動,但我不知道為什么底部欄不顯示,這是否是正確的方法?

我這樣做的方法是擁有一個Activity其中包括一個占據大部分窗口的ViewFlipper和一個位於底部的按鈕欄。 孩子的“活動”只是ViewFlipper孩子。 很好

后來添加的示例:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"
    android:orientation="vertical" 
>
    <ViewFlipper 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"
        android:layout_weight="1"
    > 

    <!-- Your pages go here, i.e.: -->
    <include android:id="@+id/page1" layout="@layout/page1" />
    <include android:id="@+id/page2" layout="@layout/page2" />
    ...

    </ViewFlipper>

    <!-- Your bottom bar -->
    <LinearLayout
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"
        android:orientation="horizontal" 
    >
    ... buttons or whatever you want here ...
    </LinearLayout>

</LinearLayout>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM