• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Image too small in ImageButton

 
Bod MacNeil
Ranch Hand
Posts: 44
Java Mac Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.  I've been trying to make a Rock, paper Scissors game.  On the left hand side of the screen I have 3 ImageButtons which the user chooses from.  On the right are 3 ImageViews which the phone randomly selects (numbered 0-2).  The problem I am having is when I run the program, the rock and paper images shirk inside the ImageButton.  Here is a pic of both of them in AndroidStudio and one in the emulator:

AndroidStudio:


Emulator:


And here is the XML code from all 3 ImageButtons:






Any help appreciated. Thanks.
 
Giovanni Montano
Ranch Hand
Posts: 255
4
Android Open BSD Slackware
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to change         android:layout_width="120sp" with         android:layout_width="120dp" in the other two images.

DP are density indipendent pixels, SP instead are dependent by the user fonts.

does it maybe works?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic