0

I'm developing an android calendar app so I need to align the days in a grid-like style. I'm using the API Level 8 so I need to align them by margins. But when switching to Bigger screens the numbers get to the left of screen and do not cover the whole screen.(I know that is because I use dp as a unit for my margin-left). Is there something like CSS % (percent) in Android Layouts?

This is What I want

Miro Markaravanes
  • 3,285
  • 25
  • 32

2 Answers2

1

Try this

android:layout_weight="1"

on each element in that section. It should space evenly.

Vic Vuci
  • 6,993
  • 6
  • 55
  • 90
0

It's weight attribute for views inside LinearLayout. Here is a good explanation what it means. But you can use it only to set view sizes, not margins. However you can put your view into RelativeLayout, place this layouts to take all available screen width and set attribute centerInParent=true in your view.

Community
  • 1
  • 1
amukhachov
  • 5,822
  • 1
  • 41
  • 60