• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can align same width of all Views within a Layout Irrespective of text in them?

 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

This is my layout coding


What I want all 3 or many views has same width of maxium Text

I know this can be acheive by setting width to match_parent or Hardcoding length of each view according to maximum width of larger text

Is there any other scalable layout method?

Like in HTML we use table for this types of task?

Thanks
Same Width Android.PNG
[Thumbnail for Same Width Android.PNG]
 
Rehan Zahoor
Ranch Hand
Posts: 83
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use of TabelLayout is recommended. Also check android:layout_width="0dp" and android:layout_weight="1".
 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Rehan

Thanks for reply
Sorry for my late reply

I have solved problem using this

android:layoutalignLeftOf="view Id"
android:layoutalignRightOf="view id"

this way it will align with parent view text
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic