是否有一种方法可以根据存储的res值在清单中定义屏幕方向?
例如:
<activity
android:name=".activities.MainActivity"
android:screenOrientation="@integer/screenOrientation"
...
我想把定位锁定在手机上,而不是平板电脑上。我是用代码做这件事的,但是在执行之前有一段很短的时间,应用程序会出现在手机上的风景中,然后突然出现在人像上。想要避开这一切。
希望我可以在整数或字符串中使用一个值,并将它们放在必需的dimen文件夹中。
如果可能的话,我一直无法为可用的定位选项找到值,有人能提供这些吗?
非常感谢!
发布于 2019-05-08 13:13:50
/** Constant for {@link #orientation}: a value indicating that no value has been set. */
public static final int ORIENTATION_UNDEFINED = 0;
/** Constant for {@link #orientation}, value corresponding to the
* <a href="{@docRoot}guide/topics/resources/providing-resources.html#OrientationQualifier">port</a>
* resource qualifier. */
public static final int ORIENTATION_PORTRAIT = 1;
/** Constant for {@link #orientation}, value corresponding to the
* <a href="{@docRoot}guide/topics/resources/providing-resources.html#OrientationQualifier">land</a>
* resource qualifier. */
public static final int ORIENTATION_LANDSCAPE = 2;
https://stackoverflow.com/questions/56048811
复制相似问题