我正在开发一个小部件,其中为了提供小部件设置,我想要提供一个带有选项卡片段的对话框,但问题是对话框没有操作栏选项卡,我尝试了各种布局模式,但似乎都不起作用。
In the manifest, have made the activity
<activity android:theme="@android:style/Theme.Dialog" android:launchMode="singleInstance" android:name="WidgetConfigureActivity"></activity>
I am not sure, which layout to use exactly ViewPager, FragmentTabHost in the UI, basically not clear which layout to go for.
WidgetConfigureActivity extends
FragmentActivity
for now, the below is the code for it(code is taken from FragmentTabHost)FragmentTabHost mTabHost; @Override protected void onCreate(Bundle arg0) { super.onCreate(arg0); setContentView(R.layout.widget_configure_activity); mTabHost = (FragmentTabHost)findViewById(android.R.id.tabhost); mTabHost.setup(this, getSupportFragmentManager(), R.id.tabhost); //this above setup line gives error => (The method setup(Context, FragmentManager, int) in the type FragmentTabHost is not applicable for the arguments (WidgetConfigureActivity, FragmentManager, int)) mTabHost.addTab(mTabHost.newTabSpec("simple").setIndicator("Simple"), MyFragment.class, null); }
ViewPager并不是很重要,但如何使用片段创建选项卡对话框才是问题所在?
4.
如果将Theme.Dialog
应用于我的活动,则如何使UI /布局不发生变化,所有字体都显示为白色背景中的白色?(我已经看到倾斜屏幕上的文本)