草庐IT

ORIENTATION_ROTATE

全部标签

android - orientation change 变为 null 后的回调

我有一个FragmentActivity,它有两个ListFragment选项卡。每个ListFragment都有一个回调。一个回调的例子回调在onAttach(...)方法内部关联OnStatusUpdateListenermStatusUpdateCallback;publicinterfaceOnStatusUpdateListener{publicvoidonStatusUpdate();}@OverridepublicvoidonAttach(Activityactivity){Log.d(TAG,"onAttach");super.onAttach(activity);tr

android - configChanges ="orientation"不会在 Galaxy Nexus 上触发

你好,我有一个奇怪的错误,当我想在GalaxyNexus(4.0.4)上触发方向更改时,它根本不会跳入onConfigurationChanged(Configuration)函数。在HTCDesire(4.0.4)上,使用相同的代码可以正常工作。即使在720p的模拟器上也能正常工作。我尝试更新到Android4.1,但我仍然遇到同样的问题。有没有人遇到同样的问题或者解决办法? 最佳答案 我看到两个设备都运行Android4.x,但请尝试添加screenSize值,如我之前的回答here中所述.

android - 如果我可以使用 android :configChanges ="keyboard|orientation|screenLayout",为什么还需要 setRetainInstance 或 onSaveInstance

为什么我需要使用setRetainInstance()或onSaveInstance()来保存状态,而我可以使用android:configChanges="keyboard|orientation|screenLayout“并获得相同的“保存状态非UI状态”?我的意思是减少头痛。 最佳答案 不要使用android:configChanges。它会以微妙的方式破坏事物,并会阻止Android为当前配置获取正确的布局/主题/尺寸等。onSaveInstanceState()与此完全正交:您需要保存状态,以便在Android终止进程以节

java - Android ViewFlipper中Rotate3dAnimation的更好实现

我想在一个View中创建一个带有map的AndroidMapActivity,它可以翻转过来,然后在另一个View中进行配置,然后再次翻转回map。我想出的解决方案有效,但我想知道是否有更好的方法来做到这一点。我从AndroidApiDemos复制了Rotate3DAnimation类,并在我的MapActivity类的顶部声明了它们:privateMapViewmMapView;privateViewFlippermFlipper;privateRotate3dAnimationmInMapAnimation;privateRotate3dAnimationmInStgAnimati

android - 如何在 Android Print Framework 中将默认的 "Portrait Orientation"更改为 Landscape?

有没有办法在打印框架中将默认纵向预览更改为横向?我试过下面-PrintAttributesattrib=newPrintAttributes.Builder().setMediaSize(PrintAttributes.MediaSize.NA_LETTER.asLandscape()).setMinMargins(PrintAttributes.Margins.NO_MARGINS).build();也试过下面-PrintAttributesattrib=newPrintAttributes.Builder().setMediaSize(PrintAttributes.MediaSi

Android CSS 位置 :fixed after a device rotate

我在GalaxyNote上的Android4.0上出现了一个非常不寻常的错误。一些friend在他们的GalaxyS3上也看到了同样的情况。我将代码简化为以下内容:#movieplayer{width:100%;position:fixed;top:0px;left:0px;right:0px;bottom:0;background:yellow;z-index:90;}.player,.project-info{width:100%}#movieplayer.short-info{width:100%;background:green;display:block;position:r

android - 这个 Android Lint 是什么意思 : "Wrong orientation?"

我在eclipse中运行Androidlint时出现错误:Wrongorientation?Noorientationspecified,andthedefaultishorizontal,yetthislayouthasmultiplechildrenwhereatleastonehaslayout_width="match_parent"Issue:ChecksthatLinearLayoutswithmultiplechildrensettheorientationId:Orientation这是错误代码:这是什么意思?如果我忽略此lint错误会发生什么?

android - css3 transform rotate3d with perspective 不适用于Android

我有一个使用3D转换的Web应用程序,它在Android4.1的Android浏览器中运行良好。但是,PhoneGap容器中的同一应用程序会产生挤压和展开动画,而不是透视3D旋转。有没有办法让它在PhoneGap中运行,或者它是否使用不能进行3D转换的不同渲染引擎?我用-webkit-perspective:300;父级和-webkit-transform:rotate3d(0,1,0,-180deg);-webkit-transform-style:preserve-3d;在旋转图像上。 最佳答案 也许phonegap可以在没有-

android - TYPE_ROTATION_VECTOR, TYPE_ORIENTATION 给出不同的结果,也有偏差

我已经为RotationVector和OrientationVector实现了监听器,虽然我知道它已经过时了,但我想同时测试这两个。我知道RotationVector是一个融合传感器并被推荐,但根据它,NORTH(getOrientation(rotationMatrix,value)geavingbearing0返回的值[0])与NORTH不匹配来自方向传感器。我还从Playstore的不同应用程序中进行了统计,方向传感器值似乎更接近它们。而且很多次我从Rotation_Vector得到的方位角值[0]然后getOrientation只是猛增并保持在-180到180之间振荡P.S“g

android - 需要根据 Sensor.TYPE_ORIENTATION 数据计算旋转矢量

我需要根据从Sensor.TYPE_ORIENTATION获得的数据计算旋转矢量。传感器数据定义如下:必须重新计算值才能成为正确的3d位置:值[0]:方位角,磁北方向与Y轴之间的角度,围绕Z轴(0到359)。0=北,90=东,180=南,270=西值1:俯仰,绕X轴旋转(-180到180),当z轴向y轴移动时为正值。values[2]:Roll,绕Y轴旋转(-90到90),当x轴远离z轴时取正值我需要所有三个值,例如Z轴值(从0到360度)。我尝试了很多但无法弄清楚如何做到这一点:/(编辑:要了解工作代码背后的想法,请查看DroidARframework的ActionWithSenso