I have an image button that I want to take to entire width of the device. The image src I am using is not as long as the button. The default seems to be to align it to the cener of the button. Instead I would like to align it to the left. I have tried using layout gravity but with no response.
Here is the code..
<LinearLayout
android:id = "@+id/llRoot"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="left" >
<ImageButton
android:id="@+id/ibSend"
android:layout_gravity="left"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/send" >
</ImageButton>
Well, I think you want your image in ImageButton to be alligned to the Left? Then add this to your ImageButton attributes:
android:scaleType="fitStart"
and here it goes, your image is aligned at left of the ImageButton.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With