android - Query with layout -
i have been working on layout lately. there 2 image shown. first 1 shows need , second 1 shows get.
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
Post a Comment