android - Query with layout -


i have been working on layout lately. there 2 image shown. first 1 shows need , second 1 shows get.

enter image description here

can suggest me how achieve linearlayout. , when linearlayout means no layout_weight or relativelayout need used. know using these 2 simplify work, want why through code not achieved. below code xml.

   <linearlayout     android:layout_width="match_parent"     android:layout_height="wrap_content" >     <button         android:id="@+id/btn"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="@string/button" />     <textview          android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="@string/mytext" />      <imagebutton         android:id="@+id/ib"         android:layout_width="wrap_content"         android:layout_height="match_parent"         android:layout_gravity="right|center_vertical"         android:src="@android:drawable/ic_lock_idle_alarm"         android:contentdescription="@+id/ibutton" />  </linearlayout> 

i adding dummy view layout_weight="1" , layout_width="0dp" between the views want on left of parent , want on right. expand fill space, assuming other views have no weight. crude effective.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -