Android RelativeLayout fix imagebutton width

37 views Asked by At

I have an imagebutton and I'd like to reduce the image size to match the control next to it. I've already achieved this, but the imagebutton is now wider than the image. How can I fix this? See attached image.

<TextView
    android:id="@+id/txtStrikes"
    style="@style/ScoreTextView"
    android:layout_alignParentRight="true"
    android:layout_alignParentTop="true"
    android:layout_marginTop="25dp"
    android:layout_marginRight="25dp"
    android:text="S"/>

<ImageButton
    android:id="@+id/cmdStrikesPlus"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/arrow"
    android:cropToPadding="false"
    android:scaleType="centerInside"
    android:adjustViewBounds="true"
    android:layout_toLeftOf="@id/txtStrikes"
    android:layout_alignTop="@id/txtStrikes"
    android:layout_alignBottom="@id/txtStrikes"/>

The space I'd like to remove is the grey sidebar in the image:

enter image description here

0

There are 0 answers