当前位置: 代码迷 >> Android >> android 页面跳转有关问题
  详细解决方案

android 页面跳转有关问题

热度:32   发布时间:2016-04-28 06:48:49.0
android 页面跳转问题
底部菜单栏不变,上面的页面可以来回跳转,这样的布局应该怎样做?
------解决方案--------------------
TabHost?
------解决方案--------------------
可以用FrameLayout布局来实现,类似:
<?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"
        android:background="#FFFFFF" >
        
        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />
        
        <RadioGroup
            android:id="@id/tabbar_item"
            android:layout_width="fill_parent"
            android:layout_height="49dip"
            android:layout_gravity="bottom"
            android:background="@drawable/tabbar_bg_green"
            android:gravity="center_vertical"
            android:orientation="horizontal" >

            <RadioButton
                android:id="@id/tabbar_item0"
                style="@style/tabbar_item"
                android:background="@drawable/tabbar_home_bg"
                android:checked="true" />

            <RadioButton
                android:id="@id/tabbar_item1"
                style="@style/tabbar_item"
                android:background="@drawable/tabbar_category_bg" />

            <RadioButton
                android:id="@id/tabbar_item2"
                style="@style/tabbar_item"
                android:background="@drawable/tabbar_my_bg" />

            <RadioButton
                android:id="@id/tabbar_item3"
                style="@style/tabbar_item"
                android:background="@drawable/tabbar_search_bg" />

            <RadioButton
                android:id="@id/tabbar_item4"
                style="@style/tabbar_item"
                android:background="@drawable/tabbar_more_bg" />
        </RadioGroup>
    </LinearLayout>


------解决方案--------------------
可以用Fragment做,fragment可以做多种效果。还可以滑动。
------解决方案--------------------
Fragment

还有一种是假的。每个activity都包含底部的同样的组件
------解决方案--------------------
tabhost+Fragment,我现在做的差不多就是这个效果,类似于微博底部有导航
------解决方案--------------------
http://blog.csdn.net/heaimnmn/article/details/19155049看下呗
------解决方案--------------------
不太复杂的话tabhost足够了!
------解决方案--------------------
Fragment和ViewPager结合起来,就可以实现
  相关解决方案