形状矩形角(android)

时间:2015-06-03 18:29:40

标签: android xml

抱歉我的英文。我想创建linerLayout只有左上角半径。例如:

enter image description here

我的xml:

Route::get()

我的shape_corner_left_top

 <LinearLayout
                    android:id="@+id/getbonusClick"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/shape_corner_left_top"
                    android:orientation="vertical" />

结果:

enter image description here

我只需要左上角的半径。我怎么做的?

1 个答案:

答案 0 :(得分:1)

我刚检查过,使用此代码,您的问题将得到解决

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
    <corners android:radius="10dp"
  android:bottomRightRadius="0dp" android:bottomLeftRadius="0dp" 
  android:topLeftRadius="10dp" android:topRightRadius="0dp"/>
    <solid android:color="@android:color/black"/>
    <stroke android:width="1dp"
        android:color="@android:color/holo_blue_dark"/>
</shape>

在eclipse上预览不正确,在设备上运行它。你会找到解决方案。

由于