摘要: public static boolean isTablet() { return "tablet".equals(SystemPropertiesEx.get("ro.build.characteristics"));} 阅读全文
posted @ 2018-08-31 17:46 代码の足迹 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 1 ActionBar2 Toolbar3 ActionMenuView4 ActionBar.Tab5 DrawerLayout6 TabHost, TabWidget7 SubTabWidget8 Spinner9 CheckBox10 ListView11 ExpandListView12 P 阅读全文
posted @ 2018-03-13 17:03 代码の足迹 阅读(401) 评论(0) 推荐(0) 编辑
摘要: 背景图片拉伸: 那么如果我们想在Activity的onCreate方法或者是onReusme方法获取组件的宽高怎么办呢?这里提供了以下的五种方式:http://blog.csdn.net/qq_23547831/article/details/51764304 1、重写Activity的onWindowFocusChanged方法 /** * 重写Acitivty的onWindowFocus... 阅读全文
posted @ 2017-10-23 20:49 代码の足迹 阅读(455) 评论(0) 推荐(0) 编辑
摘要: context.getResources()用法总结 1、context.getResources().getConfiguration().orientation;//获取屏幕方向int类型,1:portrait,2:landscape 把资源文件放到应用程序的/raw/raw下,以openRawResource方法(不带后缀的资源文件名)打开这个文件 2、InputStream fs =... 阅读全文
posted @ 2017-10-18 17:24 代码の足迹 阅读(14660) 评论(0) 推荐(0) 编辑
摘要: ipad屏幕适配 1.android:screenOrientation="unspecified|portrait|landscape" 2.adb shell getprop ro.sf.lcd_density //dpi=400 sw-xxxx-dp中的xxxx的计算公式是 sw *160/dpi 屏幕分辨率1920X1080 xxxx=1080*160/400=432 2、andr... 阅读全文
posted @ 2017-10-17 20:04 代码の足迹 阅读(1454) 评论(0) 推荐(0) 编辑
摘要: 安卓中像素px和dp的转换: public int Dp2Px(Context context, float dp) { final float scale = context.getResources().getDisplayMetrics().density; //当前屏幕密度因子 return (int) (dp * scale + 0.5f); } publ... 阅读全文
posted @ 2017-10-17 19:21 代码の足迹 阅读(5673) 评论(0) 推荐(0) 编辑
摘要: 1 Android 使用Vector XML文件创建矢量图片资源 2 blog:http://blog.csdn.net/klxh2009/article/details/51121034 3 所需工具: 4 1、阿里巴巴矢量图库(http://www.iconfont.cn/) 5 2、GIMP(GNU Image Manipulation Program) 6 其中,GIMP我提... 阅读全文
posted @ 2017-10-17 19:20 代码の足迹 阅读(1701) 评论(0) 推荐(0) 编辑
摘要: @override onCreateViewHolder(){} 阅读全文
posted @ 2017-09-25 09:06 代码の足迹 阅读(15996) 评论(0) 推荐(0) 编辑
摘要: 1 EditText 2 3 1、//当给EditText设置圆角背景属性的时候,外层有CounterTextLayout,需要把圆角背景属性设置在CounterTextLayout布局中 5 6 9 10 11 12 2、rect_co... 阅读全文
posted @ 2017-09-25 08:56 代码の足迹 阅读(528) 评论(0) 推荐(0) 编辑