开发者

android: how to set tabs of tabhost in two lines?

Now I want to set the tab widget like t开发者_开发问答his style:

android: how to set tabs of tabhost in two lines?

how should I do? All I know the possibility is to modify the Android source code, Any better ideas? Thanks a lot!


I use Fragment to perform the trick: Please see the Android's Doc. So you should add for example 4 buttons in what ever layout and show 4 different Fragment by click one of them, below is the sample to show one Fragment:

    FragmentTransaction ft = getFragmentManager().beginTransaction();
    Fragment prev = getFragmentManager().findFragmentByTag(TAG_APP_DIALOG); 
    if (prev != null) {
        ft.remove(prev);
    }
    // Create and show the dialog fragment.
    DialogFragment newFragment = AppDialogFragment.newInstance(folderName, this, appInfos);
    newFragment.setRetainInstance(false);
    ft.add(mRootLayout.getId(), newFragment, TAG_APP_DIALOG);
    ft.commit();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜