android: how to set tabs of tabhost in two lines?
Now I want to set the tab widget like t开发者_开发问答his style:
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();
精彩评论