动态设置Fragment、view主题



fragment:

final Context contextThemeWrapper = new ContextThemeWrapper(getActivity(), R.style.Widget_MainTabPageIndicator);  
        LayoutInflater localInflater = inflater.cloneInContext(contextThemeWrapper);  
         mRootView =  localInflater.inflate(R.layout.fragment_main, container, false);


view:

final View tabView = new View (new ContextThemeWrapper(getContext(), defaultStyle));


textView

textView.setTextAppearance(context, R.style.mystyle);


RelativeLayout someLayout = new RelativeLayout(context, null, R.style.LightStyle);


你可能感兴趣的:(动态设置Fragment、view主题)