当前位置:首页 » 安卓系统 » 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中实现全屏,去掉标题栏效果

方法:在布局文件的预览界面,如下图操作

这样就成功去除了标题栏。

热点内容
三位数乘两位数速算法 发布:2025-05-12 13:05:48 浏览:389
暴风影音缓存在哪里 发布:2025-05-12 12:42:03 浏览:535
access数据库exe 发布:2025-05-12 12:39:04 浏览:623
五开的配置是什么 发布:2025-05-12 12:36:37 浏览:359
加密ovpn 发布:2025-05-12 12:01:55 浏览:45
python练手项目 发布:2025-05-12 11:14:07 浏览:123
压缩听算音频 发布:2025-05-12 10:58:12 浏览:801
数据库系统报告 发布:2025-05-12 10:43:17 浏览:603
日产高配有哪些配置 发布:2025-05-12 10:32:16 浏览:475
大众朗逸哪个配置值得入手 发布:2025-05-12 10:31:20 浏览:505