0

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

Marcel
  • 917
  • 3
  • 19
  • 48
  • If you want to fix the size of imagebutton, you can directly pass width or height or both directly instead of wrap_content – Pramod Yadav Sep 10 '17 at 09:12
  • @PramodYadav yeah, but that will lead to inflexible values – Marcel Sep 10 '17 at 09:26
  • whatever the size you are using in your style="@style/ScoreTextView", you can also use the same size here, so, if thke size changes it will also reflect here – Pramod Yadav Sep 10 '17 at 09:31

0 Answers0