解决android中使用shape文件画虚线不显示
2014-10-21 10:34
381 查看
shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line"> <stroke android:width="@dimen/dimen_1_dip" android:color="#000000" android:dashWidth="@dimen/dimen_10_dip" android:dashGap="@dimen/dimen_10_dip" /> </shape>
定义shape文件如下
但是使用之后在真机上没有虚线效果
根据网上大神们的解释是使用hardwareAccelerate引起的渲染错误...解决方法如下:
1. 把这个Activity的硬件加速关了... manifest里 android:hardwareAccelerated="false"
2. 或者从View层级上把硬件加速关掉 view.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
亲测有效,特此记录。
相关文章推荐
- 【Android使用Shape绘制虚线,在4.0以上的手机显示实线】解决方式
- android 使用shape绘制虚线时,在4.0机型上显示实线
- 【Android使用Shape绘制虚线,在4.0以上的手机显示实线】解决方案
- Android中使用shape来定义控件的显示属性
- 【Android Training - Performance】提高显示布局文件的性能[Lesson 3 - 按需载入视图(ViewStub的使用方法)]
- [Cocos2D-X]使用iconv解决VS上中文显示乱码的问题+android导入第三方库iconv
- 关于在Android中使用Google Map只显示网格问题的解决方法
- 解决Eclipse进行Android开发时logcat不显示问题-使用DDMS
- libgdx 使用particle editor导出文件后在android中载入不显示问题
- Android 使用libmp3lame开源库 解决录音文件转换成mp3文件
- Android中使用Toast.cancel()方法优化toast内容显示的解决方法
- 解决android使用google map时显示方格的问题
- 解决android使用google map时显示方格的问题
- 解决android使用adb工具push文件时出现read-only
- 使用Form验证,未登录时登录页面无法显示图片、css、js文件的解决方法
- 【Android Training - Performance】提高显示布局文件的性能[Lesson 2 - 使用include标签重用Layout]
- Android(decode文件转成bitmap)使用BitmapFactory.Options解决加载大图片内存溢出
- Android中常常使用shape来定义控件的一些显示属性,今天看了一些shape的使用,对shape有了大体的了解,稍作总结: 先看下面的代码: <shape>
- android手机命令行下不能使用sqlite3命令查看*.db数据库文件解决办法
- android手机命令行下不能使用sqlite3命令查看*.db数据库文件解决办法