Android使用 selector 自定义控件背景 (以spinner 为例)
1. 在drawable中设置背景spinner_style.xml 文件 如图:


2. 在 styles.xml 中添加该背景

3. 最后在 spinner 控件添加样式

4.参考 http://www.cnblogs.com/top5/archive/2012/05/10/2494763.html
Android使用 selector 自定义控件背景 (以spinner 为例)的更多相关文章
- Android的selector,背景选择器
原文地址 http://android.blog.51cto.com/268543/564581 首先android的selector是在drawable/xxx.xml中配置的,相关图片放在同目录下 ...
- 浅谈android的selector,背景选择器
shape和selector的结合使用 (2013-04-07 11:11:00) 转载▼ 分类: android 1.Shape (1)作用:XML中定义的几何形状 (2)位置:res/draw ...
- Android的selector 背景选择器
关于listview和button都要改变android原来控件的背景,在网上查找了一些资料不是很全,所以现在总结一下android的selector的用法.首先android的selector是在d ...
- Android中Selector的用法(改变ListView和Button的默认背景)
Android中的Selector的用法 http://blog.csdn.net/shakespeare001/article/details/7788400#comments Android中的S ...
- Android中selector背景选择器
http://blog.csdn.net/forsta/article/details/26148403 http://blog.csdn.net/wswqiang/article/details/6 ...
- android实现下拉框(spinner),自己定义大小颜色背景位置,去掉默认样式黑边
1. 实现最简单的spinner xml文件,有一个TextView,一个Spinner: <RelativeLayout xmlns:android="http://schemas. ...
- Android开发技巧——自定义控件之增加状态
Android开发技巧--自定义控件之增加状态 题外话 这篇本该是上周四或上周五写的,无奈太久没写博客,前几段把我的兴头都用完了,就一拖再拖,直到今天.不想把这篇拖到下个月,所以还是先硬着头皮写了. ...
- Android 设置进度条背景
Android 设置进度条背景 直接上代码 <ProgressBar android:id="@+id/progressBar" android:layout_width=& ...
- Android 自学之列表选择框Spinner
列表选择框(Spinner)与Swing编程里面的Spinner不同,这里的Spinner其实就是一个列表选项框. Spinner是ViewGroup的间接子类,因此他也可作为容器使用. Spinne ...
随机推荐
- js compress and combine
http://www.cnblogs.com/snandy/archive/2012/06/08/2541827.html http://developer.51cto.com/art/201301/ ...
- Bomb Game
hdu3622:http://acm.hdu.edu.cn/showproblem.php?pid=3622 题意:你有n次,每次你可以在平面上放置一个点,并且每一次都会有两个位置可以选,每一次只能选 ...
- append
之前一次使用append就是插入不成功, 这次好了,可以了 原来是js和javascript不能混了.
- 【转】 各种 基于Unity3d 引擎的Android游戏优化 (drawcall)
合并纹理,减少贴图数量,合并网格,ui上减少不必要的层级叠加关系等 1. 更新不透明贴图的压缩格式为ETC 4bit,因为android市场的手机中的GPU有多种,每家的GPU支持不同的压缩格式 ...
- bzoj 2286 [Sdoi2011]消耗战(虚树+树上DP)
[题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=2286 [题意] 给定一棵树,切断一条树边代价为ci,有m个询问,每次问使得1号点与查询 ...
- 折腾iPhone的生活——iOS设备重刷固件
iOS设备升级系统总共有这么几种方法: 1.OTA升级,也就是我们最常碰到的,在设备上,连上Wifi,在设置里面的软件更新就可以直接通过Wifi安装新的系统(已越狱设备不要这样升级) 2.通过iTun ...
- codeforces A. Jeff and Rounding (数学公式+贪心)
题目链接:http://codeforces.com/contest/351/problem/A 算法思路:2n个整数,一半向上取整,一半向下.我们设2n个整数的小数部分和为sum. ans = |A ...
- flexpaper 与js 交互
flash 代码//写到要响应的方法体中import flash.external.ExternalInterface;ExternalInterface.call("alert" ...
- Spring3 M2 quartz-2.1.7 解决bean不能注入问题
我们要达到这样的效果 public class CancelUnpaidOrderTask implements Job { @Autowired private AppOrderService or ...
- poj1691绘画板
1 7 0 0 2 2 1 0 2 1 6 2 2 0 4 2 1 1 2 4 4 2 1 4 3 6 1 4 0 6 4 1 3 4 6 6 2 #include<stdio.h> #i ...