0

I write a rectangle widget.

After writing its portrait XML, I want to write its landscape.

  1. I should change any LinearLayout orientation from horizontal to vertical?

    horizontal is right to left (not top to bottom) relative to the screen in origin portrait mode?

  2. If i don't mention layout_height property, what is the default? (match parent?)

  3. how does weight property take effect when I specify layout_width = X dip?

    when I specify layout_width = wrap_content?

  4. what does fill_parent mean when in top-most LinearLayout?

TN888
  • 7,659
  • 9
  • 48
  • 84
Elad Benda
  • 35,076
  • 87
  • 265
  • 471

2 Answers2

0

1a) No, you should not.

1b) Horizontal is left to right relative to the screen in origin portrait mode.

2) There is no default value, you have to set it (other time you will see an error)

3) Please look at that question

4) The view should be as big as its parent (minus padding)

Community
  • 1
  • 1
TN888
  • 7,659
  • 9
  • 48
  • 84
0

To give the task of managing screen orientation to Android on behalf, you don't need to think all this stuff. Just mention android:configChanges="orientation|keyboardHidden|screenSize|screenLayout" in your activity from AndroidManifest.xml

Sazzad Hissain Khan
  • 37,929
  • 33
  • 189
  • 256