• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Button Size

 
Muhammad Imad Qureshi
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a lot of buttons in my app. I want each button to be same size (three characters each). Some buttons have only 2 characters but I still want their size to be three characters and text aligned in the middle. I know wrap content will shrink the size to 2 characters when buttons have only 2 characters. how can I set a constant size for all buttons?

Thanks
Imad
 
Ksh Aggarwal
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can set the Height and Width of your button to a common value to stop auto resizing.

P.S. Caution: Fixing size of UI elements 'might' create problems with compatibility with devices of different screen size & density
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should set the Height and Width property of a button to a fixed value. Ensure that you make these specification in "dip" units.

(Whats the difference between dp, sp, pt, px etc. ?)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic