LinearLayout的setOrientation方法不接受参数VERTICAL,与android引用中的以下内容相反
public void setOrientation(int orientation)从:API级别1布局应该是列还是行.相关XML属性*android:orientation参数orientation通过HORIZONTAL或VERTICAL.默认值为HORIZONTAL.
我尝试使用import android.widget.LinearLayout尝试失败.*
通过黑客攻击,我能够发现1是垂直的,工作正常,但这是一个应该修复的错误.
任何人都有一个简单的方法来沉默未记录的UIDevice setOrientation警告?
我发现这段代码使未记录的UIPickerView setSoundsEnabled警告无声.
尝试使用字符串限定符在清单文件中设置方向
android:screenOrientation="@string/orientation"
Run Code Online (Sandbox Code Playgroud)
适用于4.0 asus平板电脑,但在2.1野火和4.1 Galaxy S上都失败了.问题实际上是链接到资源,如果输入肖像,则可以使用.
我试过更改平板电脑中使用的限定符来测试手机.这意味着所有设备都使用完全相同的代码,资源和布局.所以它不能拼写错误或构建问题.但它仍然在手机而不是平板电脑上失败了.这似乎是android中的另一个错误.
给出下面的错误,logcat中没有任何内容
Installation error: INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION
Please check logcat output for more details.
Launch canceled!
Run Code Online (Sandbox Code Playgroud)
清单部分
<activity
android:name=".MainActivity"
android:screenOrientation="@string/orientation"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
我知道我可以以编程方式完成.但这是野火的另一个问题,而不是立即重启.相反,它等待视图设置等.这在其他设备中不会发生.
谷歌搜索并发现其他一些人使用这些方法,但他们似乎没有发现任何问题. http://capdroid.wordpress.com/2012/07/21/different-screen-orientation-on-different-screen-size
谢谢