- 浏览: 358905 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
驭乐MJ:
你好,我卸载rar后,按命令执行安装unrar或者是p7zip ...
Ubuntu rar 乱码问题 -
郭建雄:
不错,受用了,谢谢你的分享 !
java线程中的interrupt,isInterrupt,interrupted方法 -
zuosheng:
...
用ViewFlipper实现各种切换动画 -
lxtkong-029:
原来一直不是很清楚,看来你的文章明白了,太感谢了!
java线程中的interrupt,isInterrupt,interrupted方法 -
ihopethatwell:
嗯,看到了,要在项目中添加jni
Ubuntu 10.04安装android NDK
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:wen=http://schemas.android.com/apk/res/com.iteye.googlers
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="wrap_content">
第二行是自定义标签。
格式如上,其中“xmlns:wen”冒号后面是标签名,在下面使用时(只对当前文件可用)
<TextView wen:属性名/>
“com.iteye.googlers”是你的工程包名。
1. reference:参考某一资源ID。
(1)属性定义:
<declare-styleable name = "名称">
<attr name = "background" format = "reference" />
</declare-styleable>
(2)属性使用:
<ImageView
android:layout_width = "42dip"
android:layout_height = "42dip"
android:background = "@drawable/图片ID"
/>
2. color:颜色值。
(1)属性定义:
<declare-styleable name = "名称">
<attr name = "textColor" format = "color" />
</declare-styleable>
(2)属性使用:
<TextView
android:layout_width = "42dip"
android:layout_height = "42dip"
android:textColor = "#00FF00"
/>
3. boolean:布尔值。
(1)属性定义:
<declare-styleable name = "名称">
<attr name = "focusable" format = "boolean" />
</declare-styleable>
(2)属性使用:
<Button
android:layout_width = "42dip"
android:layout_height = "42dip"
android:focusable = "true"
/>
4. dimension:尺寸值。
(1)属性定义:
<declare-styleable name = "名称">
<attr name = "layout_width" format = "dimension" />
</declare-styleable>
(2)属性使用:
<Button
android:layout_width = "42dip"
android:layout_height = "42dip"
/>
5. float:浮点值。
(1)属性定义:
<declare-styleable name = "AlphaAnimation">
<attr name = "fromAlpha" format = "float" />
<attr name = "toAlpha" format = "float" />
</declare-styleable>
(2)属性使用:
<alpha
android:fromAlpha = "1.0"
android:toAlpha = "0.7"
/>
6. integer:整型值。
(1)属性定义:
<declare-styleable name = "AnimatedRotateDrawable">
<attr name = "visible" />
<attr name = "frameDuration" format="integer" />
<attr name = "framesCount" format="integer" />
<attr name = "pivotX" />
<attr name = "pivotY" />
<attr name = "drawable" />
</declare-styleable>
(2)属性使用:
<animated-rotate
xmlns:android = "http://schemas.android.com/apk/res/android"
android:drawable = "@drawable/图片ID"
android:pivotX = "50%"
android:pivotY = "50%"
android:framesCount = "12"
android:frameDuration = "100"
/>
7. string:字符串。
(1)属性定义:
<declare-styleable name = "MapView">
<attr name = "apiKey" format = "string" />
</declare-styleable>
(2)属性使用:
<com.google.android.maps.MapView
android:layout_width = "fill_parent"
android:layout_height = "fill_parent"
android:apiKey = "0jOkQ80oD1JL9C6HAja99uGXCRiS2CGjKO_bc_g"
/>
8. fraction:百分数。
(1)属性定义:
<declare-styleable name="RotateDrawable">
<attr name = "visible" />
<attr name = "fromDegrees" format = "float" />
<attr name = "toDegrees" format = "float" />
<attr name = "pivotX" format = "fraction" />
<attr name = "pivotY" format = "fraction" />
<attr name = "drawable" />
</declare-styleable>
(2)属性使用:
<rotate
xmlns:android = "http://schemas.android.com/apk/res/android"
android:interpolator = "@anim/动画ID"
android:fromDegrees = "0"
android:toDegrees = "360"
android:pivotX = "200%"
android:pivotY = "300%"
android:duration = "5000"
android:repeatMode = "restart"
android:repeatCount = "infinite"
/>
9. enum:枚举值。
(1)属性定义:
<declare-styleable name="名称">
<attr name="orientation">
<enum name="horizontal" value="0" />
<enum name="vertical" value="1" />
</attr>
</declare-styleable>
(2)属性使用:
<LinearLayout
xmlns:android = "http://schemas.android.com/apk/res/android"
android:orientation = "vertical"
android:layout_width = "fill_parent"
android:layout_height = "fill_parent"
>
</LinearLayout>
10. flag:位或运算。
(1)属性定义:
<declare-styleable name="名称">
<attr name="windowSoftInputMode">
<flag name = "stateUnspecified" value = "0" />
<flag name = "stateUnchanged" value = "1" />
<flag name = "stateHidden" value = "2" />
<flag name = "stateAlwaysHidden" value = "3" />
<flag name = "stateVisible" value = "4" />
<flag name = "stateAlwaysVisible" value = "5" />
<flag name = "adjustUnspecified" value = "0x00" />
<flag name = "adjustResize" value = "0x10" />
<flag name = "adjustPan" value = "0x20" />
<flag name = "adjustNothing" value = "0x30" />
</attr>
</declare-styleable>
(2)属性使用:
<activity
android:name = ".StyleAndThemeActivity"
android:label = "@string/app_name"
android:windowSoftInputMode = "stateUnspecified | stateUnchanged | stateHidden">
<intent-filter>
<action android:name = "android.intent.action.MAIN" />
<category android:name = "android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
注意:
属性定义时可以指定多种类型值。
(1)属性定义:
<declare-styleable name = "名称">
<attr name = "background" format = "reference|color" />
</declare-styleable>
(2)属性使用:
<ImageView
android:layout_width = "42dip"
android:layout_height = "42dip"
android:background = "@drawable/图片ID|#00FF00"
/>
发表评论
-
通过FutureTask设置超时,用于请求网络,执行任何异步超时任务
2013-10-10 15:53 0public class TestConnectTimeOu ... -
使用Eclipse调试Android Native Application
2013-07-08 21:31 0由于最近需要调试C++程序,以后都是暴力调试的,暴力调 ... -
Android新版NDK环境配置(免Cygwin)
2013-07-05 08:41 0前言:Android NDK r7及以上的版本已经集成 ... -
scroller 滚动效果
2013-04-25 14:22 0package com.testalaph; i ... -
点9 ondraw bitmap
2013-04-17 14:26 0private void init(Context ... -
点9 ondraw bitmap
2013-04-17 14:20 0点9图片ondraw画: private void ... -
通过activityGroup动态管理activity
2013-01-20 15:54 0// @Override // protected v ... -
scroller text view 滚动文字
2012-12-08 10:18 0package com.sc; import an ... -
android 截屏
2012-11-05 14:16 0//截屏2 private Bitmap jieping2 ... -
Android下Dialog及Activity屏蔽Home键详解
2011-12-13 11:53 0屏蔽其他键,重写onKeyDown Java代码 ... -
clipRect 介绍
2011-12-02 14:13 6674android的clip有以下两点疑问: Clip(剪切)的 ... -
android知识整理
2011-11-03 10:06 11. android单实例运行方 ... -
Android 使用junit测试
2011-08-05 16:18 916使用方式也非常的简单,只需要在AndroidManifest ... -
Android开发:调试工具集
2011-08-05 15:07 17891. 查看当前堆栈1) 功能:在程序中加入代码,使可以在log ... -
Drawable Mutations(Android Drawable 深入分析)
2011-07-11 11:08 1624Android's drawables对编写 ... -
检查系统是否安装某app
2011-07-11 10:45 923/** * Indicates whether th ... -
ImageView的scaletype属性
2011-07-07 13:21 813ImageView的属性android:scaleType ... -
Android UI --- 设置ProgressBar的颜色
2011-07-04 14:26 1244基本原理是在drawable目录中建立一个xml文件,描述一下 ... -
关于android的ListView优化
2011-06-24 16:58 10711.去除ListView的黑色间隔线 vie ... -
PopupWindow定位全解析
2011-06-03 11:21 1975showAsDropDown(View anch ...
相关推荐
自定义属性都存在于/value/attr.xml文件中,以如下格式存在。 代码如下: ”自定义属性名称”> <attr name=”属性名称” format=”属性种类”/> …… 对于自定义属性中的format的值及其含义如下: format属性值:...
Android自定义控件属性详细介绍 1. reference:参考某一资源ID。 (1)属性定义: <attr xss=removed xss=removed> (2)属性使用: <ImageView android:layout_width = 42dip android:layout_...
Android原生控件只有横向进度条一种,而且没法变换样式,比如原生rom的样子 很丑是吧,当伟大的产品设计要求更换前背景,...android:attr/progressBarStyleHorizontal” android:layout_width=”match_parent”
在Android开发中,往往要用到自定义的控件来实现我们的需求或效果。在使用自定义 控件时,难免要用到自定义属性,那怎么使用自定义属性呢? 在文件res/values/下新建attrs.xml属性文件,中定义我们所需要的属性。 ...
大家也可以结合《理解Android中的自定义属性》这篇文章进行学习,后续一篇还有应用。 1、attrs文件编写 <?xml version=1.0 encoding=utf-8?> <resources> <attr name=titleText format=string> <attr ...
Android自定义View中attrs.xml的实例详解 我们在自定义View的时候通常需要先完成attrs.xml文件 在values中定义一个attrs.xml 然后添加相关属性 这一篇先详细介绍一下attrs.xml的属性。 <?xml version=1.0 ...
可以自定义的属性有: <!-- 滑动解锁控件 xml配置属性 --> <attr name=slideImageViewWidth format=dimension/><!-- 滑块宽度 --> <attr name=slideImageViewResId format=reference/><!-- 滑块...
在上一篇的文章中介绍了自定义控件的属性,详情见《详解Android自定义控件属性TypedArray以及attrs》。那么在这基础上实现随机验证码生成,里面的代码是自定义控件以及涉及到自定义view绘画。 1、先看实现的效果图 ...
自定义View和自定义属性的知识不再此提及,这里着重说的是属性在自定义View中的获取方式,自定义的属性如下: <?xml version=1.0 encoding=utf-8?> <resources> <attr name=wisely_1 format=boolean> ...
首先看看效果图(录制的gif有点卡,真实的效果还是很流畅的) ...首先定义一些要用到的属性 <attr name=textSize format=dimension> <attr name=textColor format=color> <attr name=paddingLeft format=dimension
Android-StickerView 支持缩放和拖动的标签视图。 通常用于将位图标记到另一个。...自定义属性详解 < ! -- sticker初始化宽高 -- > < attr xss=removed xss=removed> < attr name = " stv_s
本文章是基于鸿洋的Android 自定义View (一) 的一些扩展,以及对Android自定义View构造函数详解里面内容的一些转载。 首先我们定义一个declare-styleable标签declare-styleable标签的作用是给自定义控件添加自定义...
Android 开发订单流程view实例详解 先看看最终效果图: 怎么样,效果还是很不错的吧?群里有人说切四张图的、recycleview的、各种的都有啊,但是最简单的就是通过自定义view来实现了~接下来让我们来实现下这个...
1、自定义属性 selectPoint:选中指示器图标 normalPoint:未选中指示器图标 pointWidth:图标宽度 switchTime:轮播间隔事件 location:指示器位置,下中或下右 <attr name=selectPoint format=reference> <...
在attrs.xml 中增加自定义的属性 <!-- 飘心动画自定义的属性 --> <attr name=initX format=dimension/> <attr name=initY format=dimension/> <attr name=xRand format=dimension/> <attr name=...