Reputation: 3909
I use 9-patch image for button's background, it is working on layout design (eclipse) but not working when application running on device, here the 9-patch image:
and the layout:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:orientation="horizontal"
android:padding="0dp" >
<Button
android:id="@+id/toggle_subscribed_thread"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/background_silver"
android:focusable="true"
android:padding="0dip"
android:text="Thread" >
<requestFocus />
</Button>
<Button
android:id="@+id/toggle_subscribed_forum"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="0dip"
android:background="@drawable/background_silver"
android:text="Forum" />
<Button
android:id="@+id/toggle_subscribed_classified"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="0dip"
android:background="@drawable/background_silver"
android:text="Classified" />
</LinearLayout>
in layout design (eclipse) it appear like this:
but, when the app is executed on android device it appear like this:
any idea, why how to solve this issue ?
thank you.
Upvotes: 1
Views: 861
Reputation: 11188
Use this image.
<Button
android:id="@+id/toggle_subscribed_forum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/background_silver"
android:text="Forum" />
Upvotes: 1