就像您第一次设置 Android 手机时迎接您的一次性初始化活动一样,我想设计它以帮助第一次用户浏览我的应用程序,如下所示:
我希望将活动或片段放置在活动上,并将输入事件传递给下面的活动。我认为最简单的方法是添加一个带有半透明主题的片段,设置下面项目尺寸的参数。
我找不到其他提出这个问题的问题,但我确信一定有人问过这个问题,但我认为我使用了错误的关键字,所以如果是这种情况,请帮我指出正确的地方。否则,这就是我的距离:
public class Setup extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
final Context contextThemeWrapper = new ContextThemeWrapper(
getActivity(), android.R.style.Theme_Translucent_NoTitleBar);
// create ContextThemeWrapper from the original Activity Context with the custom theme
LayoutInflater localInflater = inflater
.cloneInContext(contextThemeWrapper);
// clone the inflater using the ContextThemeWrapper
return localInflater.inflate(R.layout.fragment_setup, container, false);
// inflate the layout using the cloned inflater, not default inflate
}
}
并添加这个片段:
FragmentTransaction transaction = getSupportFragmentManager()
.beginTransaction();
mFrag = new ModeFragment();
transaction.replace(R.id.fragment_container, mFrag, TAG.MODEFRAG);
Fragment frag = new Setup();
transaction.add(R.id.fragment_container, frag).commit();
这是我不知道该怎么做:
- 将其设置为半透明而不是透明
- 从模式片段中获取尺寸
- 在按钮周围创建一个类似的蓝色东西(这在我可以复制的任何地方都可用吗?
- 设置上述项目的尺寸
一个很长的清单,但任何帮助将不胜感激!