Loading

摘要: 以获取高德地图的key值为例 获取代码 阅读全文
posted @ 2017-01-02 16:51 辉灬 阅读(1229) 评论(0) 推荐(0) 编辑
摘要: 有的手机拍出来的照片是被旋转过得,此时,需要先旋转回正常的角度,再进行处理 读取图片旋转角度 旋转图片 阅读全文
posted @ 2017-01-02 16:48 辉灬 阅读(1966) 评论(0) 推荐(0) 编辑
摘要: 一、利用 ItemViewType 区分普通项和头部尾部 二、将头部和尾部的项设置为占据整行,而不是像普通项一样只占据一个格子 给 RecyclerView 设置 GridLayoutManager 布局管理器 在适配器中,利用 position 来判定每一项的类型:头部,普通项,底部 然后对应不同 阅读全文
posted @ 2017-01-02 16:44 辉灬 阅读(3334) 评论(0) 推荐(0) 编辑
摘要: google官方例子: https://github.com/googlesamples/android-RuntimePermissions Android 6.0在我们原有的AndroidManifest.xml声明权限的基础上,又新增了运行时权限动态检测。 以下权限都需要在运行时判断: 运行时 阅读全文
posted @ 2017-01-02 16:40 辉灬 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 在继承的BaseExpandableListAdapter的ExpandableListView的Adapter中,重写以下方法 然后设置ExpandableListView的 setOnChildClickListener。即可实现子Item的点击事件 阅读全文
posted @ 2017-01-02 16:30 辉灬 阅读(4600) 评论(0) 推荐(0) 编辑
摘要: java代码 使用string.xml格式化 其中 $.2f 就是设置保留2位小数 阅读全文
posted @ 2017-01-02 16:13 辉灬 阅读(943) 评论(0) 推荐(0) 编辑
摘要: 利用 layer-list 组合多个 shape 实现 <?xml version="1.0" encoding="UTF-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <!-- 设置填充 阅读全文
posted @ 2017-01-02 16:10 辉灬 阅读(5223) 评论(0) 推荐(0) 编辑
摘要: /** * dp转px * @param context * @param dp * @return */ public static int dp2px(Context context, float dp){ final float scale = context.getResources().getDispla... 阅读全文
posted @ 2017-01-02 16:09 辉灬 阅读(410) 评论(0) 推荐(0) 编辑
摘要: 在换肤时,先在attr.xml中定义Resource的属性名,再到stytle中,根据不同的主题,给属性赋值。 在布局文件中可直接以 android:background="?attr/app_bg" 引用。 在代码中则以以下方式获取资源 /** 获取attr的资源 */ public int ge 阅读全文
posted @ 2017-01-02 16:01 辉灬 阅读(376) 评论(0) 推荐(0) 编辑
摘要: Android将一行文本设置为多种样式时,可以使用 SpannableString 来实现 另外也可以使用html样式字符串,然后调用 Html.fromHtml(String source) 生成多样式的文本 阅读全文
posted @ 2017-01-02 15:33 辉灬 阅读(322) 评论(0) 推荐(0) 编辑