Android-UI容器与边缘
有人知道我如何在顶部左侧创建带有边缘和标签的容器吗 例如:Android-UI容器与边缘,android,user-interface,Android,User Interface,有人知道我如何在顶部左侧创建带有边缘和标签的容器吗 例如: 我尝试了背景图像,但在平板电脑上缩放有问题。您可以使用RelativeLayout来放置带有笔划和文本+按钮的背景容器。然后放置一个属性为android:layout\u alignParentTop=true的TextView <RelativeLayout ...> <LinearLayout .... android:background="@drawable/blue
我尝试了背景图像,但在平板电脑上缩放有问题。您可以使用
RelativeLayout
来放置带有笔划和文本+按钮的背景容器。然后放置一个属性为android:layout\u alignParentTop=true的TextView
<RelativeLayout
...>
<LinearLayout
....
android:background="@drawable/blue_stroke">
//Text + Button
</LinearLayout>
<TextView
...
android:background="@android:color/white"
android:layout_alignParentTop="true"/>
</RelativeLayout>
//文本+按钮
看起来你是对的,图片中有圆角布局。要做到这一点,请使用如下代码:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFFFF"/>
<stroke android:width="3dip" android:color="#B1BCBE" />
<corners android:radius="10dip"/>
<padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" />
</shape>
资料来源:
及
在这种情况下,您将不会有缩放问题