Stupid Android Layout Tricks -


android layouts have changed bit since i've been away topic , never had deep before, forgive hope relatively simple question.

say developing card game human player , 3 computer or remote opponents (not quite accurate, close enough purposes). plan there 4 children layouts representing each of player's "hands". ones on left , right display images in top down order. ones on top , bottom display images in left-to right order.

it's reasonable assume left , right layouts have identical (gravity, right?) behavior (if different start , end pixels). same goes top , bottom. if matters, usage restricted landscape mode.

what correct method of getting said childlayouts correct locations? what's correct top level layout(s) use this? should player's children layouts be? (i have assumed gridlayouts, seemsa host of others might work -- nothing hold number of dynamically generated imageviews)

once i've got layouts in right location, i'm good...i think.

tx in advance

the answer apparently use layout_width , layout_height params gridlayout specifying need inside of relativelayout (in case know using 1200 x 600 device, i'm sure there better way go this.

<gridlayout         android:layout_width="500px"         android:layout_height="100px"         android:layout_alignparenttop="true"         android:layout_centerhorizontal="true"         android:id="@+id/north"> </gridlayout>  <gridlayout         android:layout_width="500px"         android:layout_height="100px"         android:layout_alignparentbottom="true"         android:layout_centerhorizontal="true"         android:id="@+id/south"> </gridlayout>  <gridlayout         android:layout_width="100px"         android:layout_height="500px"         android:layout_alignparentleft="true"         android:layout_centervertical="true"         android:id="@+id/west"> </gridlayout>  <gridlayout         android:layout_width="100px"         android:layout_height="500px"         android:layout_alignparentright="true"         android:layout_centervertical="true"         android:id="@+id/east"> 

Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -