• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Image too small in ImageButton  RSS feed

 
Ranch Hand
Posts: 62
2
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.
 
Ranch Hand
Posts: 480
10
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
Boost this thread!