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首页的消息和电话的切换,首页的头部(完全用布局控制)的更多相关文章

  1. 仿QQ菜单栏:消息,电话菜单

    转载自:http://blog.csdn.net/johnnyz1234/article/details/45919907 在实际项目开发使用Fragment的时候,也碰到一些异常和存在的问题,下面做 ...

  2. Android仿QQ ios dialog,仿QQ退出向上菜单

    Android仿QQ ios dialog,仿QQ退出向上菜单 EasyDialog两种模式 仿QQ退出向上菜单,自己定义向上菜单              github地址:https://gith ...

  3. Android 仿QQ消息界面

    values 下面 dimens.xml <resources> <!-- Default screen margins, per the Android Design guidel ...

  4. android 仿QQ手机版

    千人2群开启,欢迎大家围观打酱油,群号145667827     您当前位置 : JavaApk-安卓应用游戏源码服务专家 » QQ » Android项目源码界面超级华丽的仿QQ最新版本 Andro ...

  5. Android仿QQ登录下拉历史列表

    demo中包含了Sqlite数据库增删改查,对存储的账号进行按照最新的时间排序,限制了最多存储5条数据. 效果图: 1.首先创建MyHelper建表: public class MyHelper ex ...

  6. Android仿qq聊天记录长按删除功能效果

    最近项目在做IM即时通讯开发,在删除聊天列表的时候跟删除聊天详细信息的时候,产品经理想要跟ios一样,在当前选中行上方弹出一个删除窗口.于是先从网上找demo,找了一个发现是Dialog做的,我感觉没 ...

  7. Android仿QQ窗口的抖动的动画效果

    就是仿照QQ窗口的抖动效果,在项目的res下创建anim文件夹,再创建两个xml文件:cycle.xml  . myanim.xml   cycle.xml  :   <?xml version ...

  8. 【转】Android仿QQ截图应用测试

    使用过QQ的同学应该都用过QQ截图,Ctrl+Alt+A进入截图操作,通过拉伸,移动高亮区域的框体可以快速截取我们需要的图片.在android应用中,我们也经常需要截图操作,以下实现了一个类似QQ截图 ...

  9. android 仿QQ气泡聊天界面

    1.现在的QQ,微信等一些APP的聊天界面都是气泡聊天界面,左边是接收到的消息,右边是发送的消息, 这个效果其实就是一个ListView在加载它的Item的时候,分别用了不同的布局xml文件. 2.效 ...

随机推荐

  1. 【BZOJ 1193】 [HNOI2006]马步距离

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 原问题可以等价为两个点. 然后其中一个点要移动到另外一个点. 那么我们可以把左下角那个点(对称总是可以得到一个点在左下角)放在原点的 ...

  2. 2015 Multi-University Training Contest 1 Tricks Device

    Tricks Device Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Tot ...

  3. HDU 1026 Ignatius and the Princess I(BFS+记录路径)

    Ignatius and the Princess I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (J ...

  4. SCN 时间戳的相互转换

    SQL> select * from v$version where rownum=1; BANNER --------------------------------------------- ...

  5. [MST] Derive Information from Models Using Views

    Redundant data or caching data is a constant source of bugs. MST adheres to the philosophy that no d ...

  6. 如何将visual studio 2010编辑模式改为插入???

    按一下键盘上的 insert button 反之亦然

  7. JS在页面限制checkbox最大复选数

    应该是挺简单的代码, 记录一下分享. 首先最直接的想法就是使用循环, 用局部变量记录已选的checkbox, 达到最大值就将余下的checkbox都禁止选择, 例如以下: <!DOCTYPE h ...

  8. Python常用目录操作(Python2)

    Python获取当前路径   Python查看指定路径下的文件和文件夹 Python修改当前工作目录(在读取文件等时需要) Python添加import路径(有时候为了import自己写的py文件,且 ...

  9. C#自定义事件监视变量变化

    首先监视定义类 class Event { public delegate void tempChange(object sender, EventArgs e); public event temp ...

  10. NodeJS学习笔记 进阶 (12)Nodejs进阶:crypto模块之理论篇

    个人总结:读完这篇文章需要30分钟,这篇文章讲解了使用Node处理加密算法的基础. 摘选自网络 Nodejs进阶:crypto模块之理论篇 一. 文章概述 互联网时代,网络上的数据量每天都在以惊人的速 ...