私は、student_info_main_container というカスタム レイアウトをロードするカスタム DialogFragment を作成しました。このレイアウトには ViewFlipper が含まれており、これを 2 つの追加レイアウトと共にロードします。問題は、ViewFlipper が DialogFragment に表示されないことですが、student_info_main_container レイアウトの残りの部分は表示されます。私の作業のほとんどは OnCreateView で行われます。どんな助けでも大歓迎です。
public class StudentInfoUIViewController : DialogFragment, IJoinClassView
{
private ViewFlipper studentInfoContentFlipper;
public static StudentInfoUIViewController NewInstance()
{
StudentInfoUIViewController frag = new StudentInfoUIViewController();
frag.SetStyle(DialogFragmentStyle.NoTitle, 0);
return frag;
}
public override void OnAttach(Activity activity)
{
base.OnAttach(activity);
Log.Debug("StudentInfoUIViewController", "OnAttach Called.");
}
//This is called to create the view and initialize the UI. The UI isn't made visible until OnStart is called.
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
Dialog.Window.SetGravity(GravityFlags.Top);
//Inflate and set the main layout for this DialogFragment
View mainView = inflater.Inflate(Resource.Layout.student_info_main_container, container, true);
//Find the ViewFlipper in the mainView
studentInfoContentFlipper = Activity.FindViewById<ViewFlipper>(Resource.Id.studentInfoMainContainer_viewFlipper_studentInfoContent);
//Inflate the layouts that are going to be added to the studentInfoContentFlipper ViewFlipper
View joinSelectionView = inflater.Inflate(Resource.Layout.student_info_join_selection, null);
View test = inflater.Inflate(Resource.Layout.test, null);
//Add the above views to the flipper.
studentInfoContentFlipper.AddView(joinSelectionView, 0);
studentInfoContentFlipper.AddView(test, 1);
Log.Debug("StudentInfoUIViewController", "OnCreateView Called.");
return mainView;
}
public override void OnStart()
{
base.OnStart();
//UI is visible
Log.Debug("StudentInfoUIViewController", "OnStart Called.");
}
}