-3
你好傢伙我知道這不是一個新問題。我從HERE獲得幫助。在我所取得成就,與平面背景圓圈按鈕,但我想要這樣的背景圖像的按鈕:Android:創建帶有背景圖像的圓形外觀按鈕
下面是相關的佈局代碼:
<LinearLayout
android:id="@+id/viewLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:background="@color/lighter_gray"/>
<Button
android:id="@+id/btnEdit"
android:background="@drawable/button_circular"
android:ellipsize="none"
android:layout_width="0dp"
android:layout_weight=".18"
android:layout_height="wrap_content" />
<View
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_weight="0.2"
android:layout_gravity="center_vertical"
android:background="@color/lighter_gray"/>
</LinearLayout>
@繪製/ button_circular
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/app_main_color"/>
<stroke android:width="2dp" android:color="@color/app_main_color" />
</shape>
我也想知道這是一個正確的方式來獲得像這樣的按鈕?提前致謝。
的。 – 2014-09-26 05:39:28
這不能解決我的問題 – user3751280 2014-09-26 06:21:18