⑴ 如何在android中實現全屏,去掉標題欄效果
方法:在布局文件的預覽界面,如下圖操作
這樣就成功去除了標題欄。
⑵ 如何在Android中實現全屏,去掉標題欄效果
android如何去掉標題欄,即去掉actionbar有兩種枝掘橡方式:
1.在配置文件中通過android:theme=""屬性隱藏:
<activity
android:name=".MainActivity"
android:label="@string/app_name"
<!-- 這行代碼便可以隱藏ActionBar -->
android:theme="@android:style/Theme.Light.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
2.在Activity代碼中隱藏:
public class MainActivity extends Activity {
ActionBar actionBar; /散滾/聲猛旁明ActionBar
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
actionBar = getActionBar(); //得到ActionBar
actionBar.hide(); //隱藏ActionBar
}
}
⑶ 如何在Android中實現全屏,去掉標題欄效果
在進行Android UI設計時,我們經常需要將屏幕設置成無標題欄或者全屏。要實現起來也非常簡單,主要有兩種方法:配置xml文件和編寫代碼設置。
1.在xml文件中進行配置
在項目的清單文件AndroidManifest.xml中,找到需要全屏或設置成無標題欄的Activity,在該Activity進行如下配置即可。
實現全屏效果:
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
實現無標題欄(但有系統自帶的任務欄):
android:theme="@android:style/Theme.NoTitleBar"
2.編寫代碼設置
在程序中編寫代碼進行設置,只需在onCreate()方法中加入如下代碼即可
實現全屏效果:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
實現無標題欄(但有系統自帶的任務欄):
requestWindowFeature(Window.FEATURE_NO_TITLE);
附:Android系統自帶樣式
android:theme="@android:style/Theme.Dialog" 將一個Activity顯示為能話框模式
android:theme="@android:style/Theme.NoTitleBar" 不顯示應用程序標題欄
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 不顯示應用程序標題欄,並全屏
android:theme="Theme.Light" 背景為白色
android:theme="Theme.Light.NoTitleBar" 白色背景並無標題欄
android:theme="Theme.Light.NoTitleBar.Fullscreen" 白色背景,無標題欄,全屏
android:theme="Theme.Black" 背景黑色
android:theme="Theme.Black.NoTitleBar" 黑色背景並無標題欄
android:theme="Theme.Black.NoTitleBar.Fullscreen" 黑色背景,無標題欄,全屏
android:theme="Theme.Wallpaper" 用系統桌面為應用程序背景
android:theme="Theme.Wallpaper.NoTitleBar" 用系統桌面為應用程序背景,且無標題欄
android:theme="Theme.Wallpaper.NoTitleBar.Fullscreen" 用系統桌面為應用程序背景,無標題欄,全屏
android:theme="Translucent" 透明背景
android:theme="Theme.Translucent.NoTitleBar" 透明背景並無標題
android:theme="Theme.Translucent.NoTitleBar.Fullscreen" 透明背景並無標題,全屏
android:theme="Theme.Panel" 面板風格顯示
android:theme="Theme.Light.Panel" 平板風格顯示
⑷ 安卓開發,怎麼做一個全屏的界面
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN)。
在android項目的主配置文件的application的屬性中設置,設置方式android:theme="@android:style/Theme.NoTitleBar.Fullscreen"。
在android項目的主配置文件的application的屬性中設置,設置方式二:
android:theme="@style/fullscreem"。
⑸ 在Android 開發中怎麼全屏顯示
全屏顯示有兩種方法
1:
在onCreate方法裡面加上這句代碼 requestWindowFeature(Window.FEATURE_NO_TITLE);
2 :
//顯示全屏
private void setFullScreen()
{
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
//[代碼] 退出全屏函數:
private void quitFullScreen()
{
final WindowManager.LayoutParams attrs = getWindow().getAttributes();
attrs.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().setAttributes(attrs);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}
⑹ android dialog 怎麼設置全屏
theme.notitlebar
:
不顯示應�'a8程序標題欄
theme.notitlebar.fullscreen
:
不顯示應用程序標題欄,並全屏
theme.light
:背景為白色
theme.light.notitlebar
:
白色背景並無標題欄
theme.light.notitlebar.fullscreen
:
白色背景,無標題欄,全屏
theme.black
:
背景黑色
theme.black.notitlebar
:
黑色背景並無標題欄
theme.black.notitlebar.fullscreen
:
黑色背景,無標題欄,全屏
theme.wallpaper
:
用系統桌面為應用程序背景
theme.wallpaper.notitlebar
:
用系統桌面為應用程序背景,且無標題欄
theme.wallpaper.notitlebar.fullscreen
:
用系統桌面為應用程序背景,無標題欄,全屏
theme.translucent
:
透明背景