I got to create a fixed menubar on the top of the screen with two image buttons in it. How can i do that ?
Thanks,
Create a RelativeLayout
and use the property android:layout_alignParentTop="true"
for the buttons.
See the code snippet:
<RelativeLayout
android:layout_height="fill_parent"
android:orientation="horizontal"
android:layout_width="match_parent">
<Button
android:layout_alignParentTop="true"
android:layout_width="120dip"
android:layout_height="wrap_content"
android:layout_marginTop="2dip"
android:id="@+id/btn_send"
android:text="Send"
android:layout_alignParentLeft="true"/>
<Button
android:id="@+id/btn_clear"
android:layout_width="120dip"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_height="wrap_content"
android:text="Reset"
/>
<!-- your rest of layout elements -->
</RelativeLayout>
精彩评论