Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • 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
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

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: 600
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?
 
So you made a portal in time and started grabbing people. This tiny ad thinks that's rude:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic