android - 形状矩形角(android)

标签 android xml

对不起我的英语。我只想创建 linerLayout 左上角半径。示例:

enter image description here

这是我的 xml:

 <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" />

这是我的 shape_corner_left_top

<?xml version="1.0" encoding="utf-8"?>
<selector
  xmlns:android="http://schemas.android.com/apk/res/android"  android:shape="rectangle">

    <item>
        <shape>
            <solid android:color="#EC6118"/>
            <corners android:bottomRightRadius="0dp"
                 android:bottomLeftRadius="0dip"
                 android:topLeftRadius="10dip"
                 android:topRightRadius="0.1dp"/>
        </shape>
    </item>

</selector>

其结果:

enter image description here

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

最佳答案

我刚刚查过了,用这段代码,你的问题就解决了

<?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 上预览不正确,在设备上运行它。您会找到解决方案。

谢谢

关于android - 形状矩形角(android),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30627913/

相关文章:

使用 Eclipse 的安卓图形用户界面

android - 为 Android 显示自定义信息窗口 Android map 实用程序库

Android View /布局屏蔽

java - Android:后台服务总是关闭

android - 从android kotlin中的文件夹获取图像列表

android - XML 约束布局 : Elements placed on top of each other, 修复了吗?

C# 无法反序列化包含 xsi :type 的 XML

xml - 如何使用 xPath 从命名空间的 xml 中检索特定元素

android - 如何使 ListWheelScrollView 水平

c# - 如何在 C# 中重命名 string[] 的 xml 元素?