2014-03-04 23 views
1

這就是我得到:Android emulator的Android領域落後出現標題

這是代碼:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="#0099cc" 
tools:context=".LoginActivity" 
android:orientation="vertical" > 

<!-- 
    The primary full-screen view. This can be replaced with whatever view 
    is needed to present your content, e.g. VideoView, SurfaceView, 
    TextureView, etc. 
--> 

<!-- 
    This FrameLayout insets its children based on system windows using 
    android:fitsSystemWindows. 
--> 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 

    <EditText 
     android:id="@+id/editText1" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:ems="10" 
     android:text="@string/UNstring" /> 

    <EditText 
     android:id="@+id/editText2" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:ems="10" 
     android:inputType="textPassword" 
     android:text="@string/PWstring" /> 

    <Button 
     android:id="@+id/button1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center" 
     android:text="@string/LIbutton" /> 

</LinearLayout> 

+0

您可以將頂部填充在第二的LinearLayout以獲取你的動作條的一些空間。 –

+0

你想不顯示標題或標題下的字段? – Pete

+0

我想要標題。我實際上添加了一個頂部填充 –

回答

0

添加機器人:marginTop屬性的第一個元素使其下降。

0

你想要操作欄嗎? 如果不是,你可以隱藏它。

public void onCreate(Bundle savedInstanceState) { 
super.onCreate(savedInstanceState); 
getWindow().requestFeature(Window.FEATURE_NO_TITLE); 
setContentView(R.layout.login); 
} 

而且在清單

Android:theme="@android:style/Theme.Black.NoTitleBar