• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Image too small in ImageButton

 
Ranch Hand
Posts: 62
2
Mac Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 606
11
Android Python Open BSD VI Editor Slackware
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
reply
    Bookmark Topic Watch Topic
  • New Topic