Android 仿QQ首页的消息和电话的切换,首页的头部(完全用布局控制)
Android 仿QQ首页的消息和电话的切换,首页的头部(完全用布局控制)
首先贴上七个控制布局代码
1.title_text_sel.xml 字体颜色的切换 放到color文件夹下面
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:color="@color/blue"/>
<item android:state_checked="false" android:color="@color/white"/>
</selector>
2.rb_bg_01.xml左边RadioButton的背景选择
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_checked="true" android:drawable="@drawable/rb_bg_01t"></item>
<item android:state_checked="false" android:drawable="@drawable/rb_bg_01f"></item>
</selector>
3.rb_bg_01f.xml左边RadioButton的背景选择
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" > <solid android:color="@color/blue"/> <corners android:topLeftRadius="15dip" android:bottomLeftRadius="15dip"/> <stroke android:width="1dip" android:color="@color/white_drak"/> </shape>
4.rb_bg_01t.xml左边RadioButton的背景选择
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" > <solid android:color="@color/white_drak"/> <corners android:topLeftRadius="15dip" android:bottomLeftRadius="15dip"/> </shape>
5.rb_bg_02.xml右边边RadioButton的背景选择
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_checked="true" android:drawable="@drawable/rb_bg_02t"></item>
<item android:state_checked="false" android:drawable="@drawable/rb_bg_02f"></item>
</selector>
6.rb_bg_02f.xml右边边RadioButton的背景选择
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" > <solid android:color="@color/blue"/> <corners android:topRightRadius="15dip" android:bottomRightRadius="15dip"/> <stroke android:width="1dip" android:color="@color/white_drak"/> </shape>
7.rb_bg_02t.xml右边边RadioButton的背景选择
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" > <solid android:color="@color/white_drak"/> <corners android:topRightRadius="15dip" android:bottomRightRadius="15dip"/> </shape>
activity_main.xml代码
<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="com.example.atest.MainActivity" > <LinearLayout
android:layout_height="wrap_content"
android:background="@color/blue"
android:gravity="center"
android:layout_width="match_parent"> <RadioGroup
android:id="@+id/rg"
android:layout_margin="10dip"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal">
<RadioButton
android:id="@+id/rb0"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight=""
android:button="@null"
android:text="消息"
android:checked="true"
android:textSize="16sp"
android:gravity="center"
android:paddingTop="6dip"
android:paddingBottom="6dip"
android:textColor="@color/title_text_sel"
android:background="@drawable/rb_bg_01"/> <RadioButton
android:id="@+id/rb1"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight=""
android:text="电话"
android:button="@null"
android:gravity="center"
android:textSize="16sp"
android:paddingTop="6dip"
android:paddingBottom="6dip"
android:textColor="@color/title_text_sel"
android:background="@drawable/rb_bg_02"/>
</RadioGroup>
</LinearLayout> </RelativeLayout>
colors.xml颜色值代码
<?xml version="1.0" encoding="utf-8"?>
<resources> <color name="blue">#18B4ED</color>
<color name="white_drak">#D0EFFA</color>
<color name="white">#FFFFFF</color> </resources>
效果图
源码下载:http://download.csdn.net/detail/pcaxb/9028951
Android 仿QQ首页的消息和电话的切换,首页的头部(完全用布局控制)的更多相关文章
- 仿QQ菜单栏:消息,电话菜单
转载自:http://blog.csdn.net/johnnyz1234/article/details/45919907 在实际项目开发使用Fragment的时候,也碰到一些异常和存在的问题,下面做 ...
- Android仿QQ ios dialog,仿QQ退出向上菜单
Android仿QQ ios dialog,仿QQ退出向上菜单 EasyDialog两种模式 仿QQ退出向上菜单,自己定义向上菜单 github地址:https://gith ...
- Android 仿QQ消息界面
values 下面 dimens.xml <resources> <!-- Default screen margins, per the Android Design guidel ...
- android 仿QQ手机版
千人2群开启,欢迎大家围观打酱油,群号145667827 您当前位置 : JavaApk-安卓应用游戏源码服务专家 » QQ » Android项目源码界面超级华丽的仿QQ最新版本 Andro ...
- Android仿QQ登录下拉历史列表
demo中包含了Sqlite数据库增删改查,对存储的账号进行按照最新的时间排序,限制了最多存储5条数据. 效果图: 1.首先创建MyHelper建表: public class MyHelper ex ...
- Android仿qq聊天记录长按删除功能效果
最近项目在做IM即时通讯开发,在删除聊天列表的时候跟删除聊天详细信息的时候,产品经理想要跟ios一样,在当前选中行上方弹出一个删除窗口.于是先从网上找demo,找了一个发现是Dialog做的,我感觉没 ...
- Android仿QQ窗口的抖动的动画效果
就是仿照QQ窗口的抖动效果,在项目的res下创建anim文件夹,再创建两个xml文件:cycle.xml . myanim.xml cycle.xml : <?xml version ...
- 【转】Android仿QQ截图应用测试
使用过QQ的同学应该都用过QQ截图,Ctrl+Alt+A进入截图操作,通过拉伸,移动高亮区域的框体可以快速截取我们需要的图片.在android应用中,我们也经常需要截图操作,以下实现了一个类似QQ截图 ...
- android 仿QQ气泡聊天界面
1.现在的QQ,微信等一些APP的聊天界面都是气泡聊天界面,左边是接收到的消息,右边是发送的消息, 这个效果其实就是一个ListView在加载它的Item的时候,分别用了不同的布局xml文件. 2.效 ...
随机推荐
- python基础8(装饰器)
1.装饰器本质 装饰器的本质:一个闭包函数 装饰器的功能:在不修改原函数及其调用方式的情况下对原函数功能进行扩展 2.装饰器函数 假设要写一个输出函数执行时间的装饰器 def timer(func): ...
- sqoop从mysql导入到hdfs出现乱码问题
最近把hive元数据库的快照数据导入到hdfs中,以便对历史的元数据进行查询. 命令如下: sqoop import -D mapred.job.queue.name=do.production -- ...
- 管理ONS(Oracle Notification Service)
Onsctl Onsctl这个命令是用来管理ONS(Oracle Notification Service)是OracleClustser实现FAN Event Push模型的基础. Oracle N ...
- Atitit.html解析器的选型 jsoup nsoup ,java c# .net 版本号
Atitit.html解析器的选型 jsoup nsoup ,java c# .net 版本号 1. 框架选型的要求 1 1.1. 文档多 1 1.2. 跨平台 1 2. html解析器特性: 1 2 ...
- html5播放m3u8视频,web端看直播
https://github.com/jiqing9006/hLive <!DOCTYPE html> <html> <head> <meta charset ...
- Sequences of sequences
I have focused on lists of tuples, but almost all the examples in this chapter also work with lists ...
- Traversing a list
The most common way to traverse the elements of a list is with a for loop. The syntax is the same as ...
- Asp.Net中使用水晶报表(下)
Asp.Net中使用水晶报表(下) 使用PUSH模式 我们采用下面的几步使用Push模式执行水晶报表: 1. 设计一个DataSet 2. 创建一个.rpt文件同时将其指定给上一步建立的DataS ...
- HDU 5223 GCD
题意:给出一列数a,给出m个区间,再给出每个区间的最小公倍数 还原这列数 因为数组中的每个数至少都为1,而且一定是这个区间的最小公约数ans[i]的倍数,求出它与ans[i]的最小公倍数,如果大于1e ...
- TypeError: 'dict' object is not callabled
Traceback (most recent call last): File "/root/Desktop/JuniperBackdoor-master/censys.py", ...