[Android]--RadioGroup+RadioButton实现底部导航栏
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实现底部导航栏的更多相关文章
- 二、Fragment+RadioButton实现底部导航栏
在App中经常看到这样的tab底部导航栏 那么这种效果是如何实现,实现的方式有很多种,最常见的就是使用Fragment+RadioButton去实现.下面我们来写一个例子 首先我们先在activi ...
- Android 高仿新浪微博底部导航栏,实现双击首页Tab,页面的ListView滚动、刷新
现在很多APP,如微信.QQ.微博等等,它们的主页面都无一例外的选择使用底部Tab导航, 通过这种方式,可以很好的把页面层级分化,很好的提高用户体验.相信,很多Android开发者,都使用到过这种经典 ...
- Android之framework修改底部导航栏NavigationBar动态显示和隐藏
原文链接 http://blog.csdn.net/way_ping_li/article/details/45727335 git diff diff --git a/frameworks/bas ...
- Android商城开发系列(三)——使用Fragment+RadioButton实现商城底部导航栏
在商城第一篇的开篇当中,我们看到商城的效果图里面有一个底部导航栏效果,如下图所示: 今天我们就来实现商城底部导航栏,最终效果图如下所示: 那么这种效果是如何实现,实现的方式有很多种,最常见的就是使 ...
- Android (争取做到)最全的底部导航栏实现方法
本文(争取做到)Android 最全的底部导航栏实现方法. 现在写了4个主要方法. 还有一些个人感觉不完全切题的方法也会简单介绍一下. 方法一. ViewPager + List<View> ...
- Android底部导航栏——FrameLayout + RadioGroup
原创文章,转载请注明出处http://www.cnblogs.com/baipengzhan/p/6285881.html Android底部导航栏有多种实现方式,本文详细介绍FrameLayout ...
- Android底部导航栏创建——ViewPager + RadioGroup
原创文章,引用请注明出处:http://www.cnblogs.com/baipengzhan/p/6270201.html Android底部导航栏有多种实现方式,本文详解其中的ViewPager ...
- Android应用底部导航栏(选项卡)实例
现在很多android的应用都采用底部导航栏的功能,这样可以使得用户在使用过程中随意切换不同的页面,现在我采用TabHost组件来自定义一个底部的导航栏的功能. 我们先看下该demo实例的框架图: 其 ...
- Android UI-仿微信底部导航栏布局
现在App基本的标配除了侧滑菜单,还有一个就是底部导航栏,常见的聊天工具QQ,微信,购物App都有底部导航栏,用户可以随便切换看不同的内容,说是情怀也好,用户体验也罢.我们开发的主要的还是讲的是如何如 ...
随机推荐
- 【BZOJ3942】Censoring [KMP]
Censoring Time Limit: 10 Sec Memory Limit: 128 MB[Submit][Status][Discuss] Description 有一个S串和一个T串,长 ...
- noip车站分级 拓扑排序
题目传送门 这道题呢 每次输入一段数就把1~n里面没有在这组数里面的数和他们连一波 表示这些数比他们等级低 然后就搞一搞就好了哇 #include<cstdio> #include< ...
- [Leetcode Week9]Word Break II
Word Break II 题解 题目来源:https://leetcode.com/problems/word-break-ii/description/ Description Given a n ...
- Swift 枚举(七)
http://blog.csdn.net/huangchentao/article/details/32714621 枚举 1.枚举语法 用enum并把定义放在大括号内,枚举中被定义的值是枚举的成员, ...
- shell整数加法
http://blog.csdn.net/ll_0520/article/details/5959577 #plus #!/bin/sh let a=$1+$2 b=$[$1+$2] ((c=$1+$ ...
- UVALIVE 2954 Task Sequences
竞赛图:图中的任意两点间有且仅有一条有向弧连接 求竞赛图中的哈密顿路的算法: 首先,由数学归纳法可证竞赛图在n>=2时必存在哈密顿路: (1)n=2时显然: (2)假设n=k时,结论成立,哈密顿 ...
- try_module_get和module_put【转】
转自:http://blog.csdn.net/adaptiver/article/details/7000617 转自:http://apps.hi.baidu.com/share/detail/4 ...
- 【互动问答分享】第5期决胜云计算大数据时代Spark亚太研究院公益大讲堂
Spark亚太研究院100期公益大讲堂 [第5期互动问答分享] Q1:spark怎样支持即席,应该不是spark sql吧,是hive on spark么? Spark1.0 以前支持即席查询的技术是 ...
- Visualbox安装Ubuntu网络设置
注意:Windows 10在安装Visualbox后,创建的Ubuntu系统只有32位的,没有64位供选择,原因是Windows 10系统自带的Hyper-V系统占用了CPU虚拟化技术,解决的方法是取 ...
- mysql 文本搜索
全文本搜索 MySQL支持几种基本的数据库引擎,但并非所有的引擎都支持全文本搜索.两个最常使用的引擎为MyISAM和InnoDB,前者支持全文本搜索,后者就不支持. 理解全文本搜索 在前面的学习中,我 ...