Android中的方向切换
我在从纵向到横向的方向转换上有任何问题 我创建此页面是因为我没有添加图像的权限 这是我的代码和两张图片 我试着制作一些小的应用程序来测试切换,我制作了和你在页面上看到的相同的文件夹,这个小的测试应用程序运行良好。但我原来的应用程序不起作用 对不起英语Android中的方向切换,android,orientation,Android,Orientation,我在从纵向到横向的方向转换上有任何问题 我创建此页面是因为我没有添加图像的权限 这是我的代码和两张图片 我试着制作一些小的应用程序来测试切换,我制作了和你在页面上看到的相同的文件夹,这个小的测试应用程序运行良好。但我原来的应用程序不起作用 对不起英语 <Button android:id="@+id/btn_menu_info" android:layout_width="wrap_content" android:layout_heigh
<Button
android:id="@+id/btn_menu_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@drawable/info64"
android:src="@drawable/info64" />
这就是问题所在。您已经完成了。您是否尝试从布局文件夹复制布局文件并将其粘贴到“布局区域”中。检查视图的id,因为logcat在onCreate中显示nullPointerException 你有吗
<Button
android:id="@+id/btn_menu_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@drawable/info64"
android:src="@drawable/info64" />
在两个menu.xml layouts(layout | layout land)文件夹中?如果将方向更改为横向,则应用程序将自动使用layout land文件夹中的XML。Eclipse无法识别ID是否存在于两个方向。Eclipse不能阻止您构建,因为它没有错误,但至少可以给您一个警告
没问题:)对我来说一切都很好。你能试试这个导入->导入视图吗。我没有注意到这可能是错误的。谢谢。
<Button
android:id="@+id/btn_menu_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@drawable/info64"
android:src="@drawable/info64" />