1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > Android怎么制作圆角矩形 如何在Android UI中绘制圆角矩形?

Android怎么制作圆角矩形 如何在Android UI中绘制圆角矩形?

时间:2020-06-07 12:38:41

相关推荐

Android怎么制作圆角矩形 如何在Android UI中绘制圆角矩形?

我想,这是你确切需要的。

这里创建圆角矩形的drawable(xml)文件。 round_rect_shape.xml

android:shape="rectangle" >

android:bottomLeftRadius="8dp"

android:bottomRightRadius="8dp"

android:topLeftRadius="8dp"

android:topRightRadius="8dp" />

这里布局文件:my_layout.xml

android:id="@+id/linearLayout1"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:background="@drawable/round_rect_shape"

android:orientation="vertical"

android:padding="5dp" >

android:id="@+id/textView1"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="Something text"

android:textAppearance="?android:attr/textAppearanceLarge"

android:textColor="#ff0000" />

android:id="@+id/editText1"

android:layout_width="match_parent"

android:layout_height="wrap_content" >

- >在上面的代码中,具有背景的LinearLayout(即放置到创建密钥的作用圆角矩形)。 因此,您可以将任何视图像TextView,EditText ...放入该LinearLayout中,以便将所有背景视为圆形矩形。现在

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。