Android的标签在AlertDialog [英] Android tabs in 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
andTabWidget
in anAlertDialog
, 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 useLayoutInflater
to create theView
that you then use withAlertDialog.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屋!