再横屏界面 进行锁屏后 解锁进入界面 界面错乱问题
来源:互联网 发布:qq群倍投软件 编辑:程序博客网 时间:2024/04/30 09:43
1..出现在滑动解锁的手机上, 在进行锁屏的时候横屏被转为了竖屏,再缓慢解屏时候竖屏显示的横屏布局界面错乱很不美观,
2.这个无法从应用层上很好的解决,只能用笨办法掩盖错乱的界面就行,用在原有的基础上再套一层FrameLayout ,同时在main 的下方加入imageView_mid3 用于设置再竖屏时候显示掩盖住main
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res/com.ubtechic.alpha1blooth"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#040c3f"
android:orientation="horizontal"
tools:context="com.ubtechinc.activity.RemoteControlActivity" >
<LinearLayout
android:id="@+id/main"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#040c3f"
android:orientation="horizontal" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<RelativeLayout
android:layout_width="260dp"
android:layout_height="260dp"
android:layout_gravity="center" >
<Button
android:id="@+id/imageView_mid"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:clickable="true" />
</RelativeLayout>
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.3" >
<RelativeLayout
android:layout_width="260dp"
android:layout_height="260dp"
android:layout_gravity="center" >
<Button
android:id="@+id/imageView_mid1"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:clickable="true" />
</RelativeLayout>
</FrameLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1.2"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="260dp"
android:layout_height="260dp"
android:layout_gravity="center" >
<Button
android:id="@+id/imageView_mid2"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:clickable="true" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
<Button
android:id="@+id/imageView_mid3"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000"
android:visibility="gone" />
</FrameLayout>
3. 配置acitivity
<activity
android:name=".MainActivity2"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
4.重写
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
// land donothing is ok
imageView_mid3.setVisibility(View.GONE);
Log.i("zdy", "ORIENTATION_LANDSCAPE");
} else if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
imageView_mid3.setVisibility(View.VISIBLE);
Log.i("zdy", "ORIENTATION_PORTRAIT");
// port donothing is ok
}
}
- 再横屏界面 进行锁屏后 解锁进入界面 界面错乱问题
- 修改Android解锁界面
- 修改Android解锁界面
- 修改Android解锁界面
- Android4.0解锁界面
- 修改Android解锁界面
- 修改Android解锁界面
- 修改Android解锁界面
- 修改Android解锁界面
- 修改Android解锁界面
- 修改Android解锁界面
- 仿IOS7解锁界面
- 修改Android解锁界面
- 模拟滑动解锁界面
- 闹钟界面会先出现解锁界面
- Ubuntu14.04循环进入登录界面问题
- 界面
- 界面
- Tutorial 3: First Triangle
- 自动处理NSLog
- 学习的力度应该与需求目的相匹配
- CRC算法详解(1)
- 基于spring mvc 移动终端后台开发
- 再横屏界面 进行锁屏后 解锁进入界面 界面错乱问题
- php基础教程
- Correlation based similarity measures-Summary
- 让Source Insight像EMACS一样工作
- 一招定位流氓软件路径文件夹
- Mysql 登陆&退出、创建&删除&选择数据库、基本数据类型、创建&删除表格
- Shell编程基础(2)
- Ubuntu Server 14.04 安装+安全Web服务器(linux+apache+mysql+php)搭建流程(更新)
- IP协议配套的四个协议:ARP RARP ICMP IGMP