Question

Now I want to set the tab widget like this style: alt text

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

Was it helpful?

Solution

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();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top