添加使用布局/ main.xml中的文件标签到Android应用 [英] Add Tabs to Android Application using the layout/main.xml file

查看:188
本文介绍了添加使用布局/ main.xml中的文件标签到Android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始与Android和我想的选项卡添加到现有的应用程序。

现在,我只是有在XML文件中定义的布局一个活动。现在我想补充的其他标签。

我看着它,发现 http://developer.android .COM /资源/教程/视图/ HELLO-tabwidget.html 在Android开发者网站;然而,不使用XML来定义标签的布局

所以,我怎么能轻松地使用XML文件只为布局添加标签?

在此先感谢。

解决方案
  

我看着它,发现 http://developer.android .COM /资源/教程/视图/ HELLO-tabwidget.html 在Android开发者网站;然而,不使用XML来定义标签的布局

是的,确实如此。参见第4步。


更新

谷歌重新组织他们的文件和摆脱了本教程。你可以看到使用XML来定义的选项卡中的 TabWidget 中的此示例项目

I am beginning with Android and I'd like to add tabs to my existing application.

Right now I just have one activity with the layout defined in the XML file. I would now like to add other tabs.

I have looked it up and found http://developer.android.com/resources/tutorials/views/hello-tabwidget.html on the Android developer site; however, that doesn't use XML for defining the layout of the tabs.

So, how can I easily add tabs using the XML file only for the layout?

Thanks in advance.

解决方案

I have looked it up and found http://developer.android.com/resources/tutorials/views/hello-tabwidget.html on the Android developer site; however, that doesn't use XML for defining the layout of the tabs.

Yes, it does. See step #4.


UPDATE

Google reorganized their documentation and got rid of this tutorial. You can see the use of XML for defining the tabs in TabWidget in this sample project.

这篇关于添加使用布局/ main.xml中的文件标签到Android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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