當前位置:首頁 » 安卓系統 » android開發全屏

android開發全屏

發布時間: 2022-04-30 00:55:43

⑴ 在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);
}

⑵ 安卓開發,怎麼做一個全屏的界面

<activity android:name="Activity" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
在activity加入 android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

⑶ 安卓開發,怎麼做一個全屏的界面

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"。
super.onCreate(savedInstanceState)。
requestWindowFeature(Window.FEATURE_NO_TITLE);//無title
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN。
WindowManager.LayoutParams.FLAG_FULLSCREEN);//全屏
setContentView(R.layout.main)。
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);//無title
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN。
WindowManager.LayoutParams.FLAG_FULLSCREEN);//全屏
setContentView(R.layout.main。

⑷ android開發做全屏界面時的問題

兩種全屏設置方法:
方法一:在AndroidManifest.xml中的Application節點中修改android:theme屬性
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
方法二:
在onCreate方法中的setContentView調用前添加
this.requestWindowFeature(Window.FEATURE_NO_TITLE);// 去標題欄
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);// 去掉Activity上面的狀態欄
此二法在網路上有很多介紹,運行後,我發現全屏功能不好用,經仔細查看,發現我在eclipse中創建工程時選的是4.0.3,模擬器在創建AVD 時選的是4.0.3(但看「關於...」中顯示的Android版本為4.0.4),貌似模擬器版本比工程版本高呀,很是奇怪,最後把AVD刪除重新創 建,這時我選擇的是4.2.2,結果功能好用了,具體原因不明呀,留後續研究,這里把問題與解決方法寫出來與大家分享!
最後結論:工程用的SDK版本比Android模擬器要高(最好能高多一點),可以解決Android程序開發中關於設置全屏無效問題!

⑸ android開發 如何設計開啟全屏沉浸模式

設置android全屏模式有兩種方法,一種是在程序代碼中設置,另一種是配置manifest.xml文件,推薦使用第二種方式。

在manifest.xml文件中<application>和<activity>標簽中都有android:theme屬性

只需要添加下面的xml代碼就好了
www.2cto.com
1 android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
例如

下面的代碼使得ActivityDemoActivity顯示為全屏模式

<activity android:name=".ActivityDemoActivity" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >

而下面的寫法則整個應用中所有都是全屏模式

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="uni.activity"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" />
<application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name=".ActivityDemoActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> </intent-filter>
</activity>
<activity android:name=".Activity01" android:label="@string/app_name">
</activity>
</application>
</manifest>

⑹ 如何設置android全屏顯示

方法/步驟

方法1: 在AndroidManifest.xml裡面添加屬性
在<activity>標簽添加屬性:
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
如下
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:label="@string/app_name"
android:name=".TestActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

方法2: 在Activity onCreate 中設置
public class TestActivity extends Activity implements OnItemClickListener {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE); //設置無標題
getWindow().setFlags(WindowManager.LayoutParams.FILL_PARENT, WindowManager.LayoutParams.FILL_PARENT); //設置全屏
setContentView(R.layout.image_list_layout);
}
}

⑺ android開發 怎麼實現全屏

在Android 開發中全屏顯示的方式有三種,分別介紹如下:
1、在Activity中進行設置,代碼如下:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
此行代碼必須寫在Activity指定布局文件之前,否則會報錯誤。
2、在android項目的主配置文件的application的屬性中設置,設置方式一:
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
3、在android項目的主配置文件的application的屬性中設置,設置方式二:
android:theme="@style/fullscreem"。

⑻ Android開發中如何設置對話框實現全屏

用DialogFragment,並且自定義一個layout布局,widht和height都設置為match_parent,然後傳入進去

java">@Nullable
@Override
publicViewonCreateView(LayoutInflaterinflater,@NullableViewGroupcontainer,@){
returninflater.inflate(R.layout.your_layout,container);
}

⑼ 如何在Android中實現全屏,去掉標題欄效果

方法:在布局文件的預覽界面,如下圖操作

這樣就成功去除了標題欄。

熱點內容
密碼鎖aid代表什麼 發布:2025-05-11 18:00:01 瀏覽:755
編程的組成 發布:2025-05-11 17:58:34 瀏覽:806
火山易語言apk反編譯 發布:2025-05-11 17:52:01 瀏覽:813
鋼琴密碼鎖本的密碼該在哪裡看 發布:2025-05-11 17:49:44 瀏覽:468
in運演算法則 發布:2025-05-11 17:41:32 瀏覽:406
微信怎麼分身兩個賬號安卓 發布:2025-05-11 17:32:14 瀏覽:915
新人采訪問題 發布:2025-05-11 17:14:29 瀏覽:899
雲伺服器有私服嗎 發布:2025-05-11 17:13:33 瀏覽:30
安卓手機怎麼轉移ipad 發布:2025-05-11 17:01:35 瀏覽:735
電腦怎麼進華為雲伺服器 發布:2025-05-11 16:53:53 瀏覽:868