您可以在可绘制文件夹中创建一个XML文件。称呼它,例如,shape.xml

在shape.xml:

xmlns:android="http://schemas.android.com/apk/res/android"

android:shape="rectangle" >

android:color="#888888" >

android:width="2dp"

android:color="#C4CDE0" >

android:left="5dp"

android:top="5dp"

android:right="5dp"

android:bottom="5dp" >

android:radius="11dp" >

的标记是您的具体问题。

根据需要进行更改。

而在你whatever_layout_name.xml:

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:orientation="vertical"

android:layout_margin="5dp"

android:background="@drawable/shape" >

这是我通常做我的应用程序。希望这可以帮助....

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐