2011-11-28 90 views
1

我該如何使用ListviewTest字樣去除頂部藍色?刪除活動中的頂部藍色

enter image description here

enter code here 




<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" android:layout_width="fill_parent" 
    android:layout_height="fill_parent" android:background="@color/gray_light2"> 
<ImageView android:id="@+id/imageView1" android:src="@drawable/impostazioni" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="-7dp"></ImageView> 
    <ListView android:id="@+id/personListView" android:divider="@null" 
     android:layout_width="fill_parent" android:layout_height="438dp"> 
    </ListView> 
</LinearLayout> 

回答

1

呼叫requestWindowFeature ...

@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState);  
    requestWindowFeature(Window.FEATURE_NO_TITLE); 
    ... 
} 
1

requestWindowFeature(Window.FEATURE_NO_TITLE);在你活動的onCreate()方法的頂部。在您的活動

3

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

在 '活動' 標籤清單文件

0

要麼添加android:theme="@android:style/Theme.Black.NoTitleBar"到活動標籤在清單或加:

requestWindowFeature(Window.FEATURE_NO_TITLE); 
      getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
            WindowManager.LayoutParams.FLAG_FULLSCREEN); 

添加到您的活動的onCreate方法。