Chr*_*ner 29 android xml-drawable shapedrawable
以下是虚线,在XML中定义为ShapeDrawable:
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<size
android:height="2dp"
android:width="700dp" />
<stroke
android:width="1dp"
android:color="@android:color/black"
android:dashWidth="1dp"
android:dashGap="2dp" />
</shape>
Run Code Online (Sandbox Code Playgroud)
这将在几个姜饼手机上绘制一个漂亮的虚线.然而,在Galaxy Nexus上,破折号似乎被忽略,并且形状被绘制为连续的线.更奇怪的是,运行ICS的仿真器将使用破折号正确渲染它,它只是物理设备搞砸了.
我错过了一些明显的东西吗 或者这真的是Android 4.0的错误吗?这条线在几个地方使用.以下是ImageView的示例:
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/observation_observe_side_margin"
android:layout_marginRight="@dimen/observation_observe_side_margin"
android:layout_marginTop="16dp"
android:contentDescription="@string/dotted_line_description"
android:src="@drawable/dotted_line" />
Run Code Online (Sandbox Code Playgroud)
sau*_*wer 48
http://code.google.com/p/android/issues/detail?id=29944上记录的问题包含将以下内容应用于您的观点的注释:
view.setLayerType(View.LAYER_TYPE_SOFTWARE, null)
Run Code Online (Sandbox Code Playgroud)
这对我有用.
Han*_*itt 23
此问题已在此处记录http://code.google.com/p/android/issues/detail?id=29944关闭硬件加速将显示虚线.
| 归档时间: |
|
| 查看次数: |
13749 次 |
| 最近记录: |