在我的应用程序中,我使用XML定义的垂直虚线.
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="90"
android:toDegrees="90">
<shape
android:shape="line">
<stroke
android:width="1dp"
android:color="@color/light_gray"
android:dashWidth="2dp"
android:dashGap="4dp"
/>
</shape>
Run Code Online (Sandbox Code Playgroud)
当我在Android Studio中挑选我的布局时,线条会正确地呈现点状,但是当我在真实设备上运行应用程序时出现问题.这条线很稳固,没有间隙.你知道问题出在哪里吗?我尝试了很多不同的设备,包括那些运行最新4.3 Android的设备.它看起来无处不在:/
我有一个虚线分隔符
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<!--
#17b851 #C7B299
-->
<stroke
android:color="#9e9c85"
android:dashWidth="10px"
android:dashGap="10px"
/>
</shape>
Run Code Online (Sandbox Code Playgroud)
现在它几乎看不到.我怎样才能让它变厚.我尝试给android:height ="2px"和android:dashHeight ="5px",但它没有用.