1

I'm just trying to display a stroked rectangle (stroke width 1dp) with rounded corners (radius 3dp). Everything looks fine on most devices, but the corners are not displayed correctly on Samsung Galaxy Tab 7.0 plus N. Here's the code:

<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"  >
    <solid android:color="#00000000"/>
    <stroke android:width="1dp" android:color="@color/borderGreen"/>
    <corners android:radius="3dp" />
</shape>

And here are the results. It's looking good on Kindle Fire HD (for example), but not so good on the Galaxy Tab:

Galaxy Tab 7.0 Kindle Fire HD

The Kindle has a higher screen resolution, but it also looks ok on devices with resolutions lower than the Galaxy Tab's. Do you have any ideas on how to circumvent this problem or will I just have to live with it?

Community
  • 1
  • 1
Flo
  • 2,309
  • 20
  • 27
  • How are you framing the rectangles? – TheDudeAbides Dec 02 '13 at 13:29
  • I'm not quite sure what you mean by 'framing'. If it's about how this drawable is used: I set it as background drawable of a TextView (upper and lower rectangle) and a RelativeLayout (center): – Flo Dec 03 '13 at 13:40

1 Answers1

0

This issue happened to me when I was adding two rectangle shapes - one containing the other one (to achieve a double-border background in my case).

I was however only applying a corner radius to the outer rectangles and not the inner one. This was causing the effect of cut out or missing rounded corners.

REM Code
  • 115
  • 6