アクティビティ間をスワイプするには、このFragmentPageAdapter
質問への回答で asを使用する必要があることを理解しています。
Fragments
ただし、動かないの周りにフレームを配置しようとしています。画面の端に固定された額縁のようなもので、スワイプするとフレームが固定され、フレームFragments
同士がスライドします。基本的にはマスキング効果。どうすればこれを実装できますか?
私の FragmentActivity の FragmentPagerAdapter には、リスト フラグメント (ArrayListFragment) である示されている例と比較して、呼び出す別の Fragment があります。私は一般的なフラグメントを次のように使用します。
public static class TestFragment extends Fragment{
/**
* Create a new instance of DetailsFragment, initialized to
* show the text at 'index'.
*/
public static TestFragment newInstance(int index) {
TestFragment f = new TestFragment();
// Supply index input as an argument.
Bundle args = new Bundle();
args.putInt("index", index);
f.setArguments(args);
return f;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.mytext, container, false);
return v;
}
}
mytext のレイアウトは非常に単純です。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:text="woohoo"
android:gravity="center"></TextView>
</LinearLayout>