
Android开发经验分享
分享android开发过程中遇到的问题和常用的开发代码
ethan_xue
这个作者很懒,什么都没留下…
展开
-
android自定义控件实例(一) 上下滑屏控件
相信大家都记得有一篇左右滑屏的控件,继承自viewGroup,通过onTouchEvent()得到xy偏移量,然后再scrollTo到指定位置因为工作要用到上下翻动的,于是我对其稍作修改,效果如图下载地址:http://download.youkuaiyun.com/detail/ethan_xue/4404245原创 2012-07-01 10:48:02 · 8804 阅读 · 2 评论 -
android自定义控件(七) onMeasure() 测量尺寸
上次讲的自定义控件刷新点屏幕的任意地方都会刷新,而且在xml里自定义控件下面放一个textview的话,这个TextView是显示不出来的,不只这个,以前的几个自定义控件都是为什么呢?今天来讲下onMeasure()在自定义刷新控件的基础上重写onMeasure方法根据上一篇自定义组件修改注释在代码里<LinearLayout xmlns:android="http://s原创 2012-03-27 23:42:29 · 29167 阅读 · 6 评论 -
android自定义控件(六) 刷新
三种得到LinearInflater的方法a. LayoutInflater inflater = getLayoutInflater();b. LayoutInflater localinflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); c.原创 2012-03-06 20:49:42 · 14042 阅读 · 1 评论 -
android自定义控件(五) 自定义组合控件
转自http://www.cnblogs.com/hdjjun/archive/2011/10/12/2209467.html 代码为自己编写目标:实现textview和ImageButton组合,可以通过Xml设置自定义控件的属性。 通过代码或者通过xml设置自定义控件的属性1.控件布局:以Linearlayout为根布局,一个TextView,一个ImageButton转载 2012-03-03 22:16:37 · 67380 阅读 · 16 评论 -
android自定义控件(四) View中的方法
onFinishInflate() 当View中所有的子控件 均被映射成xml后触发onMeasure(int, int) 确定所有子元素的大小onLayout(boolean, int, int, int, int) 当View分配所有的子元素的大小和位置时触发onSizeChanged(int, int, int, int) 当view的大小发生变化时触发onD原创 2012-03-03 15:50:45 · 10195 阅读 · 4 评论 -
android自定义控件(三) 增加内容 自定义属性 format详解
转自 http://www.gisall.com/html/35/160435-5369.html1. reference:参考某一资源ID。 (1)属性定义: background" format = "reference" /> (2)属性使用:转载 2012-03-03 14:53:45 · 10277 阅读 · 10 评论 -
android自定义控件(三) 自定义属性
书接上回 在xml里建立属性,然后java代码里用typedArray获得这些属性,得到属性后,利用属性做一些事.例:得到xml里的color,赋给paint.1.在res/values/下新建attrs.xml format详解可参照http://blog.youkuaiyun.com/ethan_xue/article/detai原创 2012-03-03 14:44:02 · 12640 阅读 · 7 评论 -
android自定义控件(二) 入门,继承View
转载请注明地址:http://blog.youkuaiyun.com/ethan_xue/article/details/7313788ps: 可根据apidemo里LableView,list4,list6学习文档在dev guide/Framework Topics/User Interface/Building Custom Components自定义控件的步骤:1 View的工原创 2012-03-02 21:55:13 · 14981 阅读 · 2 评论 -
android自定义控件(一) 官方文档的翻译
构建自定义组件Android中,你的应用程序程序与View类组件有着一种固定的联系,例如按钮(Button)、文本框(TextView),可编辑文本框(EditText),列表框(ListView),复选框(CheckBox),单选框(RadioButton),滚动条(Gallery),微调器(Spinner), 等等,还有一些比较先进的有着特殊用途的View组件,例如AutoComple翻译 2012-03-02 20:19:38 · 11318 阅读 · 2 评论 -
android 开源组件合集-非UI篇
1.Android-Universal-Image-Loaderhttps://github.com/nostra13/Android-Universal-Image-Loader推荐使用2.afinalhttps://github.com/yangfuhai/afinal个人认为bug超多,图片部分是封装的google的官网代码,使用简便了,但是bug多了,不建议原创 2013-04-26 16:43:30 · 3323 阅读 · 0 评论 -
android 开源组件合集-UI篇(2014-08-25更新)
其实也算不上合集,只是将我经常用到的部分整理一下,如果您有好东西,也可以留言补充1.actionbarhttp://actionbarsherlock.com/https://github.com/JakeWharton/ActionBarSherlock (推荐)2.pulltorefreshhttps://github.com/johannilsson/android-原创 2013-03-31 14:16:13 · 36451 阅读 · 8 评论