在res/drawable新建radiobutton.xml(本案例为video——evaluate.xml)如下

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_enabled="true"
android:state_checked="true"
android:drawable="@drawable/comment_highlight" />
<item
android:state_enabled="true"
android:state_checked="false"
android:drawable="@drawable/comment_normail" /> <item
android:state_enabled="true"
android:state_checked="false"
android:drawable="@drawable/comment_normail" />
<item
android:state_enabled="true"
android:state_checked="false"
android:drawable="@drawable/comment_normail" /> <item
android:state_enabled="true"
android:state_checked="false"
android:drawable="@drawable/comment_normail" /> </selector>

布局文件:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f3f3f3"
android:orientation="vertical" > <include layout="@layout/titlebar" /> <TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="15dp"
android:paddingLeft="10dp"
android:text="对此次服务满意吗?"
android:textColor="#2e2e2e"
android:textSize="@dimen/text_size18sp" /> <View
android:layout_width="fill_parent"
android:layout_height="0.8dp"
android:layout_marginTop="10dp"
android:background="@color/expertlist_divider_color" /> <RadioGroup
android:id="@+id/evaluate_rg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@color/white"
android:paddingBottom="8dp"
android:paddingTop="8dp" > <RadioButton
android:id="@+id/radio1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:paddingBottom="10dp"
android:checked="true"
android:text="非常满意"
android:textSize="18sp"
android:button="@drawable/video_evaluate" /> <View
android:layout_width="fill_parent"
android:layout_height="0.3dp"
android:layout_marginTop="10dp"
android:background="@color/expertlist_divider_color" /> <RadioButton
android:id="@+id/radio2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:text="满意"
android:textSize="18sp"
android:button="@drawable/video_evaluate" /> <View
android:layout_width="fill_parent"
android:layout_height="0.3dp"
android:layout_marginTop="10dp"
android:background="@color/expertlist_divider_color" /> <RadioButton
android:id="@+id/radio3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="一般"
android:textSize="18sp"
android:button="@drawable/video_evaluate" /> <View
android:layout_width="fill_parent"
android:layout_height="0.3dp"
android:layout_marginTop="10dp"
android:background="@color/expertlist_divider_color" /> <RadioButton
android:id="@+id/radio4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="不满意"
android:textSize="18sp"
android:button="@drawable/video_evaluate" /> <View
android:layout_width="fill_parent"
android:layout_height="0.3dp"
android:layout_marginTop="10dp"
android:background="@color/expertlist_divider_color" /> <RadioButton
android:id="@+id/radio5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="非常不满意"
android:textSize="18sp"
android:button="@drawable/video_evaluate" /> <View
android:layout_width="fill_parent"
android:layout_height="0.3dp"
android:layout_marginTop="10dp"
android:background="@color/expertlist_divider_color" />
</RadioGroup> <Button
android:id="@+id/bt_evaluate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="30dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@drawable/expert_yuye_bg_selector"
android:text="提交"
android:textColor="@color/white"
android:textSize="@dimen/text_size16sp" /> </LinearLayout>

效果,自己可以优化一下再:

RadioButton 自定义控件的更多相关文章

  1. WPF自定义控件与样式(4)-CheckBox/RadioButton自定义样式

    一.前言 申明:WPF自定义控件与样式是一个系列文章,前后是有些关联的,但大多是按照由简到繁的顺序逐步发布的等,若有不明白的地方可以参考本系列前面的文章,文末附有部分文章链接. 本文主要内容: Che ...

  2. 【转】WPF自定义控件与样式(4)-CheckBox/RadioButton自定义样式

    一.前言 申明:WPF自定义控件与样式是一个系列文章,前后是有些关联的,但大多是按照由简到繁的顺序逐步发布的等 本文主要内容: CheckBox复选框的自定义样式,有两种不同的风格实现: RadioB ...

  3. [WPF 自定义控件]在MenuItem上使用RadioButton

    1. 需求 上图这种包含多选(CheckBox)和单选(RadioButton)的菜单十分常见,可是在WPF中只提供了多选的MenuItem.顺便一提,要使MenuItem可以多选,只需要将MenuI ...

  4. 【Android自定义控件】支持多层嵌套RadioButton的RadioGroup

    前言 非常喜欢用RadioButton+RadioGroup做Tabs,能自动处理选中等效果,但是自带的RadioGroup不支持嵌套RadioButton(从源码可看出仅仅是判断子控件是不是Radi ...

  5. WPF自定义控件与样式(3)-TextBox & RichTextBox & PasswordBox样式、水印、Label标签、功能扩展

    一.前言.预览 申明:WPF自定义控件与样式是一个系列文章,前后是有些关联的,但大多是按照由简到繁的顺序逐步发布的等,若有不明白的地方可以参考本系列前面的文章,文末附有部分文章链接. 本文主要是对文本 ...

  6. Android笔记——Android自定义控件

    目录: 1.自定义控件概述 01_什么是自定义控件 Android系统中,继承Android系统自带的View或者ViewGroup控件或者系统自带的控件,并在这基础上增加或者重新组合成我们想要的效果 ...

  7. WPF自定义控件与样式(1)-矢量字体图标(iconfont)

    一.图标字体 图标字体在网页开发上运用非常广泛,具体可以网络搜索了解,网页上的运用有很多例子,如Bootstrap.但在C/S程序中使用还不多,字体图标其实就是把矢量图形打包到字体文件里,就像使用一般 ...

  8. WPF自定义控件与样式(2)-自定义按钮FButton

    一.前言.效果图 申明:WPF自定义控件与样式是一个系列文章,前后是有些关联的,但大多是按照由简到繁的顺序逐步发布的等,若有不明白的地方可以参考本系列前面的文章,文末附有部分文章链接. 还是先看看效果 ...

  9. 老猪带你玩转android自定义控件一——打造最简单viewpagerindicator

    viewpagerindicator,既使用viewpager翻页时候,标题的指示条随着改变的控件,是常用android控件之一,几乎所有的新闻类APP中都有使用.如下图所示: 今天,我们将从0到1实 ...

随机推荐

  1. [under the hood]Reduce EXE and DLL Size with LIBCTINY.LIB

    Matt Pietrek Download the code for this article: Hood0101.exe (45KB) W ay back in my October 1996 co ...

  2. U盘FAT32转换NTFS格式

    运行----cmd----convert x:/fs:ntfs回车 x标识你的U盘或硬盘盘符 比如你的U盘是H盘,那就是h:/fs:ntfs  FAT32----NTFS是不可逆转的转换.

  3. 【PRML读书笔记-Chapter1-Introduction】1.5 Decision Theory

    初体验: 概率论为我们提供了一个衡量和控制不确定性的统一的框架,也就是说计算出了一大堆的概率.那么,如何根据这些计算出的概率得到较好的结果,就是决策论要做的事情. 一个例子: 文中举了一个例子: 给定 ...

  4. Dbvisualizer9.0.6 解决中文乱码

    一.设置编辑器的编码 Tools->Tools Properties ->General->File Encoding 设置为UTF-8 二.如果数据库为UTF-8,则要在连接时做以 ...

  5. 搭建WebRtc环境

    0.前言 这次的需求,准备做的是一个类似与QQ视频一样的点对点视频聊天.这几天了解了一些知识后,决定使用HTML5新支持的WebRtc来作为视频通讯.客户端使用支持HTML5浏览器即可.服务器段需要提 ...

  6. VS-Visual Studio-IIS Express 支持局域网访问

    本文转自:http://www.itnose.net/detail/6132793.html 使用Visual Studio开发Web网页的时候有这样的情况:想要在调试模式下让局域网的其他设备进行访问 ...

  7. sqlmap 技巧整理

    收集了一些利用Sqlmap做注入测试的TIPS,其中也包含一点绕WAF的技巧,便于大家集中查阅,欢迎接楼补充.分享. TIP1 当我们注射的时候,判断注入 http://site/script?id= ...

  8. 修改efi分区

    换了ssd硬盘,速度真快! 我特意准备了一个efi分区(fat32,忘记指定efi了),然而win10安装时不能指定启动位置,自己创建了一块. 下面我们把让win10使用自己创建的efi分区. 以管理 ...

  9. MyBatis 元素类型为 "configuration" 的内容必须匹配 ".....

    修改MyBatis配置文件时,添加typeAliases节点,报了一个BuilderException: org.apache.ibatis.exceptions.PersistenceExcepti ...

  10. hdu 2014鞍山赛区 5073 Galaxy

    题意:就是给你 n 个数,代表n个星球的位置,每一个星球的重量都为 1 ! 开始的时候每一个星球都绕着质心转动,那么质心的位置就是所有的星球的位置之和 / 星球的个数 现在让你移动 k 个星球到任意位 ...