Android(安卓)屏幕设置
修改Android项目的AndroidManifest.xml设置:
1、控制屏幕方向(横屏/竖屏),默认自动切换,修改Activity的配置:
//竖屏
android:screenOrientation="portrait"
//横屏
android:screenOrientation="landscape"
2、不显示窗口标题(window title),最大化窗口,默认显示,修改Activity的配置:
android:theme="@style/Theme"
//res/values/styles.xml
<style name="Theme" parent="android:Theme">
<item name="android:windowBackground">@null</item>
<item name="android:windowNoTitle">true</item>
</style>
3、不显示状态条(state bar),完全全屏(fullscreen),默认显示,修改程序:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
requestWindowFeature(Window.FEATURE_NO_TITLE);
4、获取屏幕的方向:横屏/竖屏。。。
if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE)
{
Log.i("info", "landscape");
}
else if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT)
{
Log.i("info", "portrait");
}
更多相关文章
- scrollview 滚动条
- android.support.v7使用,出错处理
- android 中使用TextView实现分段显示不同颜色的字符串
- Android修改字体样式
- exp: 修改Android中strings.xml文件, 动态改变数据
- [RK3399][Android7.1] 调试笔记 --- 设置搜狗为开机默认输入法
- android 当系统存在多个Launcher时,如何设置开机自动进入默认的La
- ImageView的scaletype属性
- android开发 列表显示(ListView)