android全屏設置
A. android studio怎麼全屏
打開settings,選擇keymap,在右側界面搜索「Full screen」如圖,點擊「toggle Full Screen mode」條目,選擇「add keybord shortcut」,在打開的界面中設置你想要的快捷鍵方式,盡量不要與已有快捷鍵沖突,然後保存,就可以使用自己定義的快捷鍵進行全屏操作了
B. Android在某個Activity當中怎麼設置全屏。
1)在代碼中設置
//設置無標題
requestWindowFeature(Window.FEATURE_NO_TITLE);
//設置全屏
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
2)在manifest配置文件中設置
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
C. 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"。
D. 在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);
}
E. 如何在Android中實現全屏,去掉標題欄效果
這是基礎問題啦,而且網路一下就能找到。我直接給個鏈接了。樓主貌似是個新手,多寫寫,看看開發文檔以後就會啦。下面給個鏈接。
http://blog.csdn.net/liudong123/article/details/7818531
順便說一下別用actionbar這種東西
F. 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程序開發中關於設置全屏無效問題!
G. 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>
H. android 切換橫屏時怎麼全屏
Android 強制設置橫屏或豎屏 設置全屏
全屏
在Activity的onCreate方法中的setContentView(myview)調用之前添加下面代碼
requestWindowFeature(Window.FEATURE_NO_TITLE);//隱藏標題
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);//設置全屏
橫屏
按照下面代碼示例修改Activity的onResume方法
@Override
protected void onResume() {
/**
* 設置為橫屏
*/
if(getRequestedOrientation()!=ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE){
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
super.onResume();
}
或者在配置文件中對Activity節點添加android:screenOrientation屬性(landscape是橫向,portrait是縱向)
android:launchMode="singleTask" android:screenOrientation="portrait">
要設置成豎屏設置成 SCREEN_ORIENTATION_PORTRAIT
I. android的全屏設置的問題
在實際的應用程序開發中,有時需要把 Activity 設置成全屏顯示,一般情況下,可以通過兩種方式來設置全屏顯示效果。其一,通過在代碼中可以設置,其二,通過manifest配置文件來設置全屏。
其一:在代碼中設置(如下)
[c-sharp] view plain
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//設置無標題
requestWindowFeature(Window.FEATURE_NO_TITLE);
//設置全屏
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
}
但要注意的是:在代碼中設置的話,設置無標題和設置全屏的兩段代碼要放置在 setContentView(R.layout.main); 這段代碼的前面。要不然會報錯。
其二:在manifest配置文件中設置
[c-sharp] view plain
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.andyidea"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".login.LoginActivity"
android:theme="@android:style/android.NoTitleBar.Fullscreen"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
在相應的Activity中節點中添加屬性:android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 即可以設置某個Activity全屏顯示。若設置成 android:theme="@android:style/Theme.NoTitleBar" 即是只是設置成無標題狀態。
J. 如何設置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);
}
}