底部菜单栏的实现

底部菜单栏两种实现方法:ViewPager:可滑动的界面;Fragment:固定的界面。

首先,页面布局,在除去顶部toolbar之后,将主界面分为两部分,一部分为界面显示区,另一部分作为底部菜单栏。

我的Android之路——底部菜单栏的实现

 

xml布局文件:content_main.xml(主页面除去toolbar后剩余部分)

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

        <FrameLayout
            android:id="@+id/fl_content"
            android:layout_width="match_parent"
            android:background="#ffffff"
            android:layout_height="0dp"
            android:layout_weight="1">
        </FrameLayout>

        <include layout="@layout/activity_bottom"/>
    </LinearLayout>
View Code

相关文章:

  • 2021-05-24
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2021-04-16
  • 2021-05-16
猜你喜欢
  • 2021-06-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-04
  • 2021-11-11
相关资源
相似解决方案