Android 完美的圆角使用形状

Android 完美的圆角使用形状,android,xml,android-layout,android-selector,Android,Xml,Android Layout,Android Selector,我怎样才能做一个完美的圆角?我什么都试过了,但结果并不像我预期的那样。请帮帮我。下面是我的代码。通过使用该代码,我得到了下图 XML tab_background_five.xml <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/tab_bg_five" android:state_selected="tru

我怎样才能做一个完美的圆角?我什么都试过了,但结果并不像我预期的那样。请帮帮我。下面是我的代码。通过使用该代码,我得到了下图

XML


tab_background_five.xml

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/tab_bg_five" android:state_selected="true" />
    <item android:drawable="@drawable/tab_bg_five_white" android:state_selected="false" />

tab_bg_five.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#CF5548" />
<corners
    android:radius="3dp"
    android:bottomRightRadius="30dp"
    android:topRightRadius="30dp" />


没有imageview边距的情况下也是一样吗?是的,没有边距的情况下,您需要将这两个设置为
android:bottomRightRadius=“HHdp”android:topRightRadius=“HHdp”/>
其中HH是高度的一半。无论如何,您没有在任何地方使用
shape.xml
。我在框架布局上使用了它1您不需要嵌套2个框架布局。一级就够了。2尝试在FrameLayout中设置android:layout\u height=“60dp”。
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#CF5548" />
<corners
    android:radius="3dp"
    android:bottomRightRadius="30dp"
    android:topRightRadius="30dp" />