Here's my XML code:
<inset
android:insetTop="5dp"
android:insetBottom="5dp"
android:insetLeft="5dp"
android:insetRight="5dp">
<shape android:shape="rectangle">
<padding android:bottom="15dp"
android:top="15dp"
android:left="-100dp"
android:right="-100dp"/>
<stroke android:color="#ffaaaaaa" android:width="1px"/>
<solid android:color="#aad8d8d8"/>
</shape>
</inset>
And this is what it looks like . As you can see in this image, the stroke width is not exactly 1 pixel. I think there's some fading effect in the stroke. On other side, I wonder when I get bitmap of this
View
via getDrawingCache()
, It seems to be okay.
Can anyone please point me out to the problem? Note that I've tried both 1px
and 1dp
but no luck with the same result. BTW, I tested on my low dpi 7" tablet running Android 4.0.4.