- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- final Context contextThemeWrapper = new ContextThemeWrapper(getActivity(), R.style.PagerTheme_PageIndicatorDefaults);
- // clone the inflater using the ContextThemeWrapper
- LayoutInflater localInflater = inflater.cloneInContext(contextThemeWrapper);
- View v = localInflater.inflate(R.layout.fragment_doctor, container, false);
- v.setOnTouchListener(mOnTouchListener);
- initViews(v);
- return v;
- }
Fragment添加Theme
最新推荐文章于 2024-11-02 14:15:15 发布
本文介绍了一个自定义Fragment视图的实现方法,通过使用LayoutInflater和ContextThemeWrapper来为Fragment设置特定的主题样式,并实现了视图的触摸监听及初始化。
448

被折叠的 条评论
为什么被折叠?



