appcompat_v7和fragment_main.xml? [英] appcompat_v7 and fragment_main.xml?

查看:114
本文介绍了appcompat_v7和fragment_main.xml?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经更新了我的Eclipse和ADT插件从v22.3至v22.6最近和公认的一些大的变化。每当我创建一个新的Andr​​oid应用程序项目似乎这是不是v22.3插件present,也该为我的理解是为了取代activity_main.xml文件fragment_main.xml文件的新appcompat_v7库。这是为什么?为什么activity_main.xml文件中没有preferred的活动布局直接了,为什么appcompat库现在包含在每一个项目中的必需品?

I've updated my eclipse and ADT Plugin from v22.3 to v22.6 recently and recognised some big changes. Whenever I create a new Android Application Project there appears a new appcompat_v7 library which wasn't present on v22.3 plugin and also a fragment_main.xml file which as I understand is meant to replace activity_main.xml file. Why is that? Why is the activity_main.xml file not preferred for activity layout directly anymore and why appcompat library is now included in every project as a necessity?

有没有办法带回没有失去任何东西创建项目的老路?顺便说一句,我创建项目与Android版本2.2到4.4兼容。

Is there a way to bring back the old way of creating projects without losing anything? By the way, I create projects compatible with Android versions from 2.2 to 4.4.

推荐答案

如果你有两个不同的布局纵向和横向模式,那么你可以简单地定位虽然不同的片段,片段是通过activity.for举例布局导航有用。 其次, 如果你甚至不能习惯它,只是从activity_main.xml删除默认code和切的fragment_layout.xml并粘贴到activity_main。 然后删除code在MainActivity.java.Then相关片段删除fragment_main.xml文件。 希望这将work.It为我工作。

Fragment is useful for navigating through layouts of activity.for example if you have two different layout for portrait and landscape mode then you can simply navigate though the different fragments. Secondly, if you can not even get used to it,just remove the default code from activity_main.xml and and cut the fragment_layout.xml and paste it to activity_main. Then delete the code related to fragment in MainActivity.java.Then delete the fragment_main.xml file. Hope it will work.It worked for me.

这篇关于appcompat_v7和fragment_main.xml?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆