RadioGroup+RadioButton组合方式打造简单实用的底部导航栏

代码块:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<FrameLayout
android:id="@+id/fl_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/rg_content"> </FrameLayout> <RadioGroup
android:paddingTop="@dimen/dp_10"
android:id="@+id/rg_content"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_60"
android:layout_alignParentBottom="true"
android:background="@color/white"
android:orientation="horizontal"> <RadioButton
android:textColor="@drawable/tv_color_selected"
android:textSize="@dimen/dp_12"
android:text="首页"
android:button="@null"
android:gravity="center_horizontal"
android:drawableTop="@drawable/ic_home_selected"
android:id="@+id/rb_home"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"/> <RadioButton
android:gravity="center_horizontal"
android:textColor="@drawable/tv_color_selected"
android:textSize="@dimen/dp_12"
android:text="产品"
android:button="@null"
android:drawableTop="@drawable/ic_loan_selected"
android:id="@+id/rb_money"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"/> <RadioButton
android:gravity="center_horizontal"
android:textColor="@drawable/tv_color_selected"
android:textSize="@dimen/dp_12"
android:text="个人"
android:button="@null"
android:drawableTop="@drawable/ic_me_selected"
android:id="@+id/rb_mine"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"/>
</RadioGroup> <View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_above="@+id/rg_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/dp_60"
android:background="@color/line_background"></View>
</RelativeLayout>

效果图片:

[Android]--RadioGroup+RadioButton实现底部导航栏的更多相关文章

  1. 二、Fragment+RadioButton实现底部导航栏

    在App中经常看到这样的tab底部导航栏   那么这种效果是如何实现,实现的方式有很多种,最常见的就是使用Fragment+RadioButton去实现.下面我们来写一个例子 首先我们先在activi ...

  2. Android 高仿新浪微博底部导航栏,实现双击首页Tab,页面的ListView滚动、刷新

    现在很多APP,如微信.QQ.微博等等,它们的主页面都无一例外的选择使用底部Tab导航, 通过这种方式,可以很好的把页面层级分化,很好的提高用户体验.相信,很多Android开发者,都使用到过这种经典 ...

  3. Android之framework修改底部导航栏NavigationBar动态显示和隐藏

     原文链接 http://blog.csdn.net/way_ping_li/article/details/45727335 git diff diff --git a/frameworks/bas ...

  4. Android商城开发系列(三)——使用Fragment+RadioButton实现商城底部导航栏

    在商城第一篇的开篇当中,我们看到商城的效果图里面有一个底部导航栏效果,如下图所示: 今天我们就来实现商城底部导航栏,最终效果图如下所示:   那么这种效果是如何实现,实现的方式有很多种,最常见的就是使 ...

  5. Android (争取做到)最全的底部导航栏实现方法

    本文(争取做到)Android 最全的底部导航栏实现方法. 现在写了4个主要方法. 还有一些个人感觉不完全切题的方法也会简单介绍一下. 方法一. ViewPager + List<View> ...

  6. Android底部导航栏——FrameLayout + RadioGroup

    原创文章,转载请注明出处http://www.cnblogs.com/baipengzhan/p/6285881.html Android底部导航栏有多种实现方式,本文详细介绍FrameLayout ...

  7. Android底部导航栏创建——ViewPager + RadioGroup

    原创文章,引用请注明出处:http://www.cnblogs.com/baipengzhan/p/6270201.html Android底部导航栏有多种实现方式,本文详解其中的ViewPager ...

  8. Android应用底部导航栏(选项卡)实例

    现在很多android的应用都采用底部导航栏的功能,这样可以使得用户在使用过程中随意切换不同的页面,现在我采用TabHost组件来自定义一个底部的导航栏的功能. 我们先看下该demo实例的框架图: 其 ...

  9. Android UI-仿微信底部导航栏布局

    现在App基本的标配除了侧滑菜单,还有一个就是底部导航栏,常见的聊天工具QQ,微信,购物App都有底部导航栏,用户可以随便切换看不同的内容,说是情怀也好,用户体验也罢.我们开发的主要的还是讲的是如何如 ...

随机推荐

  1. fresco的使用教程

    1.加载依赖 api 'org.xutils:xutils:3.5.0' 2.创建一个myapplication public class MyApplication extends Applicat ...

  2. IDEA 使用maven创建web项目,打包war时不会创建class文件

    使用maven创建项目后我有创建了个src的目录,导致maven编译不能识别我创建的src文件下的Java文件 修改这样后就可以识别编译Java文件 今天又给自己挖了个坑.......

  3. 移动端去掉a标签点击时出现的背景

    之前做移动端的Portal时,手机上测试,点击a标签总是出现一个背景框 在CSS中添加 -webkit-tap-highlight-color: rgba(0, 0, 0, 0);就可以了 a:act ...

  4. [BZOJ1026][SCOI2009]windy数 解题报告|数位dp

    Description windy定义了一种windy数.不含前导零且相邻两个数字之差至少为2的正整数被称为windy数. windy想知道,在A和B之间,包括A和B,总共有多少个windy数? 一直 ...

  5. CDLinux 自动休眠功能的关闭方法

    CDLinux 自动休眠功能的关闭方法: 控制台下使用xset命令来完成. xset q  可以查看当前屏幕保护和电源管理的状态信息 具体设置时,常用的有以下参数: xset s  //这个参数设置屏 ...

  6. MySQL 查询语句练习1

    1.创建成绩表,字段包括:学生姓名,语文成绩,数学成绩,英语成绩 向表中插入多条数据: 查询: (1) 查询所有学生的数学成绩和总成绩 (2) 查询所有学生的语文和数学成绩和,按从高到低排序 (3) ...

  7. XCode Playground Overview

    http://rshankar.com/xcode-6-and-playground/ Playground is an interactive work environment that allow ...

  8. linux中链表的使用【转】

    转自:http://blog.csdn.net/finewind/article/details/8074990 Linux下链表的使用方法跟我们常规的不一样,通常情况下,链表的next指针都指向节点 ...

  9. UVALIVE 3486 Cells

    通过入栈出栈顺序判断祖先关系 这里UVALIVE还 #include <map> #include <set> #include <list> #include & ...

  10. 查询ubuntu系统版本相关信息

    查询ubuntu系统版本相关信息 sky@sky-virtual-machine:~$ cat /etc/issueUbuntu 12.04.5 LTS \n \l proc目录下记录的当前系统运行的 ...