0

I'm using Eclipse with Android SDK. As we all know, when we develop websites, we can set objects' width, height and margins between them in percentages. Today it's really important because of the responsive design. But how can I achieve this effect in Eclipse when I develop an Android app?

I don't want to rely on graphics, I want to make boxes like divs in html and set their width/height parameters in percentages, depending on the smartphone's resolution. Is it possible to achieve? What should I use?

JohnDoe
  • 25
  • 1
  • 4
  • 1
    instead of giving size in percentages you should go with [android:layout_weight](http://developer.android.com/reference/android/widget/LinearLayout.LayoutParams.html#attr_android:layout_weight) – SilentKiller May 05 '14 at 10:54

1 Answers1

0

android:layout_weight attribute will allow you to use percentages.for more info check the links below :

http://developer.android.com/training/multiscreen/index.html

Percentage width in a RelativeLayout

Community
  • 1
  • 1
M.Khouli
  • 3,992
  • 1
  • 23
  • 26