2011-03-05 209 views
0

您好我是一個新的開發者,我只是想創建自己的一些應用程序。 在我的應用程序我已經把兩個按鍵在底部,這個問題是被顯示在頁面的頂部我的應用程序的名稱和主要頁面是不可見完全,因此在底部的按鈕是不可見的。如何解決這個問題.....應用程序名稱

+0

您可以發佈截圖? – fredley

回答

1

頂欄是使用活動主題,你可以閱讀更多關於here控制。

最重要的是,您應該使用比較靈活的佈局之一,比如RelativeLayout或LinearLayout,它們會自動調整屏幕上可用空間內項目的位置。你可以閱讀更多有關這些here.

0

您可以使用以下方法來使標題欄(其中應用程序的名稱出現)走開:

requestWindowFeature(Window.FEATURE_NO_TITLE); 

說它裏面onCreate(),只需調用super.onCreate()

避免使用AbsoluteLayout,並嘗試以下列方式使用RelativeLayout達到你想要的東西:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/mother_container" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 

    <Button android:id="@+id/btn_left" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentLeft="true" 
     android:text="Button Left" /> 

    <Button android:id="@+id/btn_right" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentRight="true" 
     android:text="Button Rigth" /> 
</RelativeLayout>