开发者

Create a fixed menu bar

开发者_开发技巧

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜