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. mapreduce出现大量task被KILLED_UNCLEAN的3个原因

    Request received to kill task 'attempt_201411191723_2827635_r_000009_0' by user ------- Task has bee ...

  2. VC++使用CImage在内存中Bmp转换Jpeg图片

    之前写了一篇<VC++使用CImage在内存中Jpeg转换Bmp图片>,通过CImage实现了在内存中Jpeg转Bmp. 既然Jpeg能转Bmp,那CImage也支持Bmp转Jpeg,与上 ...

  3. mysql__视图

    视图 1.什么是视图 视图是一种虚拟存在的表,对于使用视图的用户来说基本上是透明的.视图并不是在数据库中实际存在的,行和列数据来自定义视图的查询中使用的表,并且是在使用视图时动态生成的 视图相对于普通 ...

  4. 关于GitHub学习的地方,很明了

    地址: http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000

  5. css之postion定位

    css position之初识 我们先看看position定位有那几个属性,下面是我从w3c的截图,为我们认识定位做初步的了解 通过上面这张图嘞,我们知道了position有5个属性,那么下面,我就来 ...

  6. Swift开发学习(二):Playground

    http://blog.csdn.net/powerlly/article/details/29674253 Swift开发学习:Playground 关于 对于软件用户.游戏玩家,大家一直都在提倡用 ...

  7. HDU3664 Permutation Counting

    Permutation Counting Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Oth ...

  8. python基础===正则表达式(转)

    正则表达式是一个很强大的字符串处理工具,几乎任何关于字符串的操作都可以使用正则表达式来完成,作为一个爬虫工作者,每天和字符串打交道,正则表达式更是不可或缺的技能,正则表达式的在不同的语言中使用方式可能 ...

  9. 配置iptables,把80端口转到8080

    在Linux的下面部署了tomcat,为了安全我们使用非root用户进行启动,但是在域名绑定时无法直接访问80端口号.众所周知,在unix下,非root用户不能监听1024以上的端口号,这个tomca ...

  10. jQuery中操作样式

    操作行间样式 // 获取div的样式 $("div").css("width"); $("div").css("color&quo ...