I need to create a layout which contains 10 squares, that fills the width of the screen
with fixed margin between them.
You can see the sketch attached.
Any ideas how to achieve that?

Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could wrap each square in either a
LinearLayoutorRelativeLayout, setting thelayout_widthto 0dp and thelayout_weightto 1 (or any value, really, as long as each has the SAME value), then use a horizontalLinearLayoutto wrap all of it.EDIT: Actually the inner LinearLayout/RelativeLayouts shouldn’t be necessary as long as you use the src field of the ImageView, not background.