- 浏览: 618288 次
- 性别:
- 来自: 济南
文章分类
- 全部博客 (164)
- android(基础) (81)
- android(进阶) (2)
- android(底层) (7)
- android(面试) (0)
- android(多媒体) (1)
- android(组件学习) (4)
- android(网络相关) (0)
- android(动画) (1)
- android(数据库) (2)
- android(UI样式) (3)
- android(xml) (0)
- android(调试) (14)
- android(环境搭建) (7)
- android(api) (1)
- C++ (1)
- C (0)
- JavaSE (2)
- Objective-c (1)
- JavaScript (0)
- 设计模式 (0)
- eclipse (3)
- javaee (4)
- 其它 (5)
- linux (18)
- Oracle (1)
- mysql (1)
- 嵌入式linux (1)
- 版本控制工具 (3)
- web前端 (1)
- python (1)
最新评论
-
chungehenyy:
android颜色对应的xml配置值,颜色表 -
u011467537:
...
android中用Spannable在TextView中设置超链接、颜色、字体 -
SurpriseLee:
不能更赞了!
android颜色对应的xml配置值,颜色表 -
u012094586:
这个代码是不是不全呀,能不能提供完整版的给予参考呢?xiexi ...
Android VideoView如何播放RTSP的流 -
luechenying:
顶上天!!!!!!!!!!!!!!!!!!
android颜色对应的xml配置值,颜色表
layer-list,include,merge使用,记录一下
转自:http://wang-peng1.iteye.com/blog/558646,
http://developer.android.com/guide/topics/resources/drawable-resource.html#LayerList
layer-list是一个静态的展示,selector是一个动态的展示。
当我们想把多个图层叠在一起现身的时候,可以使用layer-list,第一个item排在最下层,第二个item排在上面,当然还可以排三层、四层......,item之间最好产生距离,不然上层的会挡住下层的,字面上是多个层,也就是你可以把多个layer放在一起然后一其显现出来 如qqw.xml
1.代码实现方式:
2.layer-list.xml方式:
然后就可以在别处引用了
例如在 android:style/Widget.ProgressBar.Large 或者其他的progressbar风格
而include的使用就是为了降低 重复书写同一个布局而使用的引用,当然他还有另一优点就是和merge的混合使用 当你想添加一个布局而这个布局本身已经有了一个layout你想直接在这个layout下添控件,而你另一个xml中必须有一个layout ,如果你直接引用include这个xml那么就会多了一个layout ,所以这时候你应该把控件填写在merge中,这样就可以直接加入到原来的layout中了。
track_list_item_common.xml
从上面的代码可以看到 merge是不需要merge的
转自:http://wang-peng1.iteye.com/blog/558646,
http://developer.android.com/guide/topics/resources/drawable-resource.html#LayerList
layer-list是一个静态的展示,selector是一个动态的展示。
当我们想把多个图层叠在一起现身的时候,可以使用layer-list,第一个item排在最下层,第二个item排在上面,当然还可以排三层、四层......,item之间最好产生距离,不然上层的会挡住下层的,字面上是多个层,也就是你可以把多个layer放在一起然后一其显现出来 如qqw.xml
1.代码实现方式:
Resources r = getResources(); Drawable[] layers = new Drawable[2]; layers[0] = r.getDrawable(R.drawable.cor_info); layers[1] = r.getDrawable(R.drawable.icon); LayerDrawable layerDrawable = new LayerDrawable(layers); ((ImageView) findViewById(R.id.imageview)).setImageDrawable(layerDrawable);
2.layer-list.xml方式:
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <!-- <item android:id="@+id/user_face_drawable" android:drawable="@drawable/h001" android:left="10.0dip" android:top="18.0dip" android:right="25.0dip" android:bottom="35.0dip" /> --> <item> <shape> <solid android:color="#FF00ff00" /> <gradient android:useLevel="true" android:type="sweep" android:startColor="#ff000000" android:endColor="#ffff0000" /> </shape> </item> <item> <rotate android:pivotX="50%" android:pivotY="50%" android:fromDegrees="0" android:toDegrees="80" android:drawable="@drawable/icon" /> </item> </layer-list>
然后就可以在别处引用了
<ImageButton android:id="@+id/btnFindMe" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:background="@drawable/qqw"/>
例如在 android:style/Widget.ProgressBar.Large 或者其他的progressbar风格
<style name="progressBarStyleSmall" parent="android:style/Widget.ProgressBar.Large"> <item name="android:indeterminateDrawable">@drawable/progress</item> </style>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <!-- <item android:drawable="@android:drawable/progress_circular_background" />--> <!-- <item> <shape android:shape="ring" android:innerRadiusRatio="3.4" android:thicknessRatio="6.0"> <gradient android:useLevel="true" android:type="sweep" android:startColor="#ff000000" android:endColor="#ffffffff" /> </shape> </item> --> <item> <rotate android:pivotX="50%" android:pivotY="50%" android:fromDegrees="0" android:toDegrees="370" android:drawable="@drawable/load2" /> </item> </layer-list>
而include的使用就是为了降低 重复书写同一个布局而使用的引用,当然他还有另一优点就是和merge的混合使用 当你想添加一个布局而这个布局本身已经有了一个layout你想直接在这个layout下添控件,而你另一个xml中必须有一个layout ,如果你直接引用include这个xml那么就会多了一个layout ,所以这时候你应该把控件填写在merge中,这样就可以直接加入到原来的layout中了。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="64dip" android:gravity="center_vertical" android:ignoreGravity="@+id/icon"> <include layout="@layout/track_list_item_common" />; </RelativeLayout>
track_list_item_common.xml
<merge xmlns:android="http://schemas.android.com/apk/res/android"> <ImageView android:id="@+id/icon" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_marginLeft="4dip" android:layout_width="60px" android:layout_height="60px"/> ... </merge>
从上面的代码可以看到 merge是不需要merge的
发表评论
-
Fragment 横竖屏切换问题
2013-04-24 14:41 1789在默认情况下当发生横 ... -
Android EditText 增加自定义过滤
2012-02-19 22:20 2391在Android中,可以通过对EditText设置setFil ... -
解决android textview自动换行问题
2012-02-16 11:46 10598今天忽然发现android项目中的文字排版参差不齐的情况非常严 ... -
通过adb命令获取Android手机的IP地址
2011-12-30 19:11 4332要获取Android手机的IP地址,必须先保证你的Androi ... -
Android 图形用户界面 之 绘图(二) Paint类 主要方法介绍
2011-12-30 09:10 1423/** * Paint类介绍 * * Pa ... -
ListView底部分隔线的问题
2011-12-20 14:42 4290在工作中遇到了一个难题,就是一个listView在最下面的一个 ... -
android获取手机上的图片和视频缩略图thumbnails
2011-11-03 22:05 10009转贴自:http://www.android123.com.c ... -
Activity中使用AIDL让Service与Activity通信
2011-10-25 00:06 2759简易计算器,默认执行1+1的计算,点击go按钮执行计算,先看效 ... -
Android图形报表之AchartEngine(附开发包+API文档)
2011-10-22 16:49 11328统计报表: Java4Less (http://java4le ... -
android中用Spannable在TextView中设置超链接、颜色、字体
2011-10-21 23:08 50415昨晚研读 ApiDemo 源码至 com.example.an ... -
android动态设置TextView字体颜色
2011-10-21 11:50 6422最近写程序就遇到了这么个难题,在TextView 上,正常字体 ... -
自定义AlertDialog样式,根据屏幕大小来显示
2011-10-19 12:43 4554先介绍一些关于AlertDialog的基本知识: ... -
Android获取屏幕分辨率及DisplayMetrics简介
2011-10-19 08:56 2796Android 可设置为随着窗口大小调整缩放比例,但即便如此, ... -
android资源文件访问android.resource
2011-10-17 09:14 4145android.resource使用转自:http://www ... -
ImageView添加边框
2011-10-16 19:37 2071import android.content.Context; ... -
Android 实现TextView中文字链接的方式
2011-10-16 14:08 2475Android 的实现TextView中文字链接的方式有很多种 ... -
android实现TextView多行文本滚动
2011-10-16 13:38 6365Android中我们为了实现文本的滚动可以在ScrollVie ... -
ListView之setEmptyView的问题
2011-10-15 23:19 4952使用listView或者gridView时,当列表为空时,有时 ... -
去掉TabActivity底部默认白线
2011-10-15 16:38 3255经过一翻百度,google终于实现了TabActivity设置 ... -
Android SDK 源码下载,eclipse关联代码
2011-10-14 10:52 2583下面地址可以下载到SDK的源代码,非官方的: 1.5——ht ...
相关推荐
C OF THE MODEL, SUCH AS LAYER THICKNESSES, FINITE ELEMENT MESH, ETC. COMMUNICATION C BETWEEN INPUTM() AND FORMOD() AND FORDIV() MUST BE VIA THE USER'S OWN COMMON C BLOCKS. WITH STATIC COMMONS (CHECK ...
Please include the words "Drag Drop" in the subject of any email regarding these components. ------------------------------------------- 6. Bug reports: ------------------------------------------- ...
(FActionIndex could appear beyond the list boundaries). Thanks to Giedrius Matonis. - ADD: Added the method TCustomProp.Assign - a source flex-property is written to stream, which is then read by...
* pkcs11-tool can use a slot based on ID, label or index in the slot list. * PIN flags are updated from supported cards when C_GetTokenInfo is called. * Support for CardOS 4.4 cards added. * Fature to...
The main features include 1. frame accurate editing for cut, copy, paste, and record. 2. insert simple transitions with video special effect. 3. an integrated text and graphics title editor. 4. ...
- Include win64 native binary in the release. - Fixed failures on big endian hosts. - BIOS: Support for up to 2M ROM BIOS images. - GUI: select mouse capture toggle method in .bochsrc. - Ported most...
list (if present) is now obtained and also checked for an ID match. Implemented additional support for the PCI _ADR execution: upsearch until a device scope is found before executing _ADR. This ...
Keytechnologies presented include multi-carrier transmission, advancedsingle-carrier transmission, advanced receivers, OFDM, MIMO andadaptive antenna solutions, advanced radio resource management ...
;;;;;;;;... 1.... 2.... 3.... 4.... 5.... 6.... The syntax of the file is extremely simple.... Section headers (e.g.... at runtime.... There is no name validation.... (e.g.... previously set variable or directive (e.g....
- Added m4v extension to video list. v2.0.14 (Nov. 12, 2009) - If wimpyApp contains a "?" then replace startupdirlist "?" with a "&". v2.0.13 (Nov. 12, 2009) - Added linkToWindow feature and ...
#include device/softwinner/polaris-common/prebuild/google/products/gms_base.mk 4、 R:\wyb\ap6212a0_a33_sc3817r\android\device\softwinner\astar-y3\BoardConfig.mk # wifi and bt configuration # 1. ...
Structure describes the arrangement of items within the container, like linked list, linear vector, etc. The structure determines how quickly items can be added, manipulated and retrieved from the ...
#include device/softwinner/polaris-common/prebuild/google/products/gms_base.mk 4、 R:\wyb\ap6212a0_a33_sc3817r\android\device\softwinner\astar-y3\BoardConfig.mk # wifi and bt configuration # 1. ...
#include device/softwinner/polaris-common/prebuild/google/products/gms_base.mk 4、 Q:\a33\ap6212a0_a33_sc3817r\android\device\softwinner\astar-y3\BoardConfig.mk # wifi and bt configuration # 1. ...
<#include "/static/scripts/headIframe.ftl"/> <table width="100%" cellpadding="0" cellspacing="0" class="list_box1"> ${base}/static/scripts/tinymce/jscripts/tiny_mce/tiny_mce.js"> tinyMCE.init({ // ...
#include device/softwinner/polaris-common/prebuild/google/products/gms_base.mk 4、 R:\wyb\ap6212a0_a33_sc3817r\android\device\softwinner\astar-y3\BoardConfig.mk # wifi and bt configuration # 1. ...
23. The five layers in the Internet protocol stack are – from top to bottom – the application layer, the transport layer, the network layer, the link layer, and the physical layer. The principal ...
LIST: 1. A Simple Poll V2.0.0 For Adobe Dreamweaver 2. Abrir Janela Pop-Up V1.0.2 (Portuguese) For Adobe Dreamweaver 3. Add Gradient Background Style V1.0.0 For Adobe Dreamweaver 4. Add onmouseout V...
4 celent,dfgrd0,dfgrd1,noel,npt,layer,kspt,kstep,kinc) c WRITE (6,*) ' c NOTE: MODIFICATIONS TO *UMAT FOR ABAQUS VERSION 5.3 (14 APR '94) c c (1) The list of variables above defining the *UMAT ...
6. Advanced CSS File Include V1.0.0 For Adobe Dreamweaver 7. Advanced Manage Workspace Layouts V1.1.1 For Adobe Dreamweaver 8. Advanced Random Images V4.3.8 For Adobe Dreamweaver 9. ASP Random Images ...