StringUtils 工具类的常用方法(转载)
摘要:http://guobin6125.iteye.com/blog/1535792
阅读全文
posted @
2017-05-11 14:22
大米稀饭
阅读(180)
推荐(0) 编辑
90、 Android UI模板设计
摘要:第一步:自定义xml属性 新建一个android项目,在values文件夹中新建一个atts.xml的文件,在这个xml文件中声明我们一会在使用自定义控件时候需要指明的属性。atts.xml 前面的name是我们要使用的属性名称,后面的format表示该属性接受的值的格式,string表示该属性的值
阅读全文
posted @
2016-05-04 12:10
大米稀饭
阅读(334)
推荐(0) 编辑
带删除小图标的EditText
摘要:1 import android.content.Context; 2 import android.graphics.Rect; 3 import android.graphics.drawable.Drawable; 4 import android.text.Editable; 5 impo...
阅读全文
posted @
2015-05-28 10:22
大米稀饭
阅读(975)
推荐(0) 编辑
自定义控件:抽屉SlidingDrawer——wrap_content非全屏
摘要:android:allowSingleTap 指示抽屉是否可以打开/通过手柄上的一个水龙头关闭。android:animateOnClick 表示所述抽屉是否应该打开/与当用户点击手柄动画关闭。 android:bottomOffset 额外偏移的把手在SlidingDrawer的底部。and...
阅读全文
posted @
2014-09-30 13:21
大米稀饭
阅读(570)
推荐(0) 编辑
slidingmenu + fragment 左右菜单滑动
摘要:content_frame.xml1 2 左侧 menu_frame.xml1 2 右侧 menu_frame_right.xml1 2 1 package com.cn.slidingmenu.fragment; 2 3 import com.actionbarshe...
阅读全文
posted @
2014-09-29 18:36
大米稀饭
阅读(1998)
推荐(0) 编辑
自定义控件:瀑布流水字母
摘要:1 8 9 15 16 22 23 1 package com.example.empire; 2 3 import android.content.Context; 4 import android.graphics.Canvas; 5 import andro...
阅读全文
posted @
2014-09-26 20:54
大米稀饭
阅读(331)
推荐(0) 编辑
Android ViewPager欢迎页+引导页+进入首页
摘要:1 import android.app.Activity; 2 import android.content.Intent; 3 import android.content.SharedPreferences; 4 import android.content.SharedPreference...
阅读全文
posted @
2014-09-26 20:23
大米稀饭
阅读(1441)
推荐(0) 编辑
自定义控件:滑动开关按钮
摘要:1 6 7 13 14 1 package com.example.testdemo; 2 3 import android.content.Context; 4 import android.graphics.Bitmap; 5 import android.graph...
阅读全文
posted @
2014-09-26 17:23
大米稀饭
阅读(447)
推荐(0) 编辑
自定义控件:滑动开关按钮(自定义属性)
摘要:【主要步骤】1、自定义类MyToggleButton继承自view。2、重写onMeasure方法,指定控件大小。3、重写onDraw方法,绘制控件内容。4、重写onTouchEvent方法,对touch事件进行解析。【为新控件添加自定义的属性】1、在attrs.xml文件中声明属性,有属性名:...
阅读全文
posted @
2014-09-26 16:43
大米稀饭
阅读(397)
推荐(0) 编辑
优酷菜单
摘要:Android中RelativeLayout各个属性的含义android:layout_above="@id/xxx" --将控件置于给定ID控件之上android:layout_below="@id/xxx" --将控件置于给定ID控件之下android:layout_toLeftOf="@id/...
阅读全文
posted @
2014-09-25 22:55
大米稀饭
阅读(294)
推荐(0) 编辑
下拉列表
摘要:1 5 6 13 14 15 23 1 package com.example.testdemo; 2 3 import java.util.ArrayList; 4 import java.util.List; 5 import android.app....
阅读全文
posted @
2014-09-25 15:28
大米稀饭
阅读(301)
推荐(0) 编辑
图片循环滑动
摘要:1 6 7 11 12 18 19 20 28 29 30 36 37 38 39 40 1 package com.example.testdemo; 2 3 i...
阅读全文
posted @
2014-09-25 15:07
大米稀饭
阅读(270)
推荐(0) 编辑
3、自定义控件-----刮刮奖
摘要:1 import android.content.Context; 2 import android.graphics.Bitmap; 3 import android.graphics.Bitmap.Config; 4 import android.graphics.Canvas; 5...
阅读全文
posted @
2014-09-20 19:58
大米稀饭
阅读(279)
推荐(0) 编辑
2、列表item_圆头像_信息提示
摘要:1 import android.app.Activity; 2 import android.os.Bundle; 3 import android.view.LayoutInflater; 4 import android.view.View; 5 import android.view.Vi...
阅读全文
posted @
2014-09-20 18:04
大米稀饭
阅读(487)
推荐(0) 编辑
1、ListView自定义控件下拉刷新(一)
摘要:1 5 6 10 11 12 17 18 24 25 31 32 33 34 1 import java.util.ArrayList; 3 import android.app.Activity; 4 imp...
阅读全文
posted @
2014-09-20 17:07
大米稀饭
阅读(910)
推荐(0) 编辑
3. 使用绘图API自定义视图 --- 旋转的方块
摘要:1 import android.content.Context; 2 import android.graphics.Canvas; 3 import android.graphics.Color; 4 import android.graphics.Paint; 5 import androi...
阅读全文
posted @
2014-08-29 19:18
大米稀饭
阅读(228)
推荐(0) 编辑
Android selector item 属性大全(按钮按下不同效果)
摘要:必须。必须是根元素。包含一个或多个元素。 Attributes:xmlns:androidString,必须。定义XML的命名空间,必须是“http://schemas.android.com/apk/res/android”. android:state_pressed ...
阅读全文
posted @
2014-08-29 17:35
大米稀饭
阅读(1979)
推荐(0) 编辑
2. 自定义控件皮肤
摘要:按钮按下,弹起 颜色变化的一个效果。1 2 1
阅读全文
posted @
2014-08-29 17:23
大米稀饭
阅读(125)
推荐(0) 编辑
1. 自定义视图属性
摘要:res/values/attrs.xml 自定义属性值1 2 3 4 5 6 7 自定义控件 ---- 长方形 1 import android.content.Context; 2 import android.content.res.TypedArray...
阅读全文
posted @
2014-08-29 17:16
大米稀饭
阅读(215)
推荐(0) 编辑