Android的标签在AlertDialog [英] Android tabs in AlertDialog

查看:148
本文介绍了Android的标签在AlertDialog的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在标签AlertDialog?

我已经经历了很多网上的教程了,他们通常把意图从一个活动到另一个选项卡。但是警告对话框都是在一个单一的活动。

我想有一个警告对话框两个选项卡。


解决方案

  

我可以在标签AlertDialog?


presumably您可以在 AlertDialog TabHost TabWidget code>,使用视图的标签。这个例子显示的看法-AS-选项卡中的活动: https://开头的github .COM / commonsguy / CW-综合/树/主/ WidgetCatalog /标签在你的情况,你会使用相同的排序布局,而是使用 LayoutInflater 来创建查看,你再与 AlertDialog.Builder 用于创建对话框。


  

我已经经历了很多网上的教程了,他们通常从一个活动的意图地方到另一个地方的标签。


这些教程已经不再恕我直言。嵌入标签活动的整体技术已经去precated。

Can I have tabs in AlertDialog?

I've gone through a lot of online tutorials and they usually place the intent from one activity to another in the tabs. However the alert dialog is all within a single activity.

I want to have two tabs in one alert dialog.

解决方案

Can I have tabs in AlertDialog?

Presumably you can use TabHost and TabWidget in an AlertDialog, using views for the tabs. This sample shows views-as-tabs in an activity: https://github.com/commonsguy/cw-omnibus/tree/master/WidgetCatalog/Tab In your case, you would use the same sort of layout, but use LayoutInflater to create the View that you then use with AlertDialog.Builder to create the dialog.

I've gone through a lot of online tutorials and they usually place the intent from one activity to another in the tabs.

Those tutorials are obsolete now IMHO. The whole technique of embedding activities in tabs has been deprecated.

这篇关于Android的标签在AlertDialog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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