Антон Лялин Asked:2020-08-01 23:57:27 +0000 UTC2020-08-01 23:57:27 +0000 UTC 2020-08-01 23:57:27 +0000 UTC 如何制作如图所示的按钮? 772 如何在白色背景上制作小图片? android 1 个回答 Voted Best Answer Антон Лялин 2020-08-02T00:22:35Z2020-08-02T00:22:35Z 终于决定了 shape_button_location.xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="9dp" /> <solid android:color="@android:color/white" /> </shape> layer_button_location.xml <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/shape_button_location" /> <item android:drawable="@drawable/ic_location" android:top="10dp" android:bottom="10dp" android:left="10dp" android:right="10dp"> </item> </layer-list> 还有我自己button <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:id="@+id/btnMap" android:layout_width="50dp" android:layout_height="50dp" android:background="@drawable/layer_button_location" android:layout_marginStart="15dp" android:layout_marginTop="15dp"/> <fragment android:id="@+id/map" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="match_parent" android:layout_height="match_parent" />
终于决定了
shape_button_location.xml
layer_button_location.xml
还有我自己
button