我在text view
中有fragment
当我点击文字视图时,会调用一个活动,这会将我带到一个我怀疑的新布局。是否可以在从片段布局到活动布局的同时进行动画制作。
这是我的片段:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;`
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Util;
using Android.Views;
using Android.Widget;
namespace TabbedApp
{
public class IconTextCallFragment : Android.Support.V4.App.Fragment
{
public override void OnCreate (Bundle savedInstanceState)
{
base.OnCreate (savedInstanceState);
}
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
// Use this to return your custom view for this Fragment
View view =inflater.Inflate(Resource.Layout.IconTxtCallLayout, container, false);
var textView = view.FindViewById<TextView>(Resource.Id.clickable_text_view);
textView.Click += StartNewActivity;
return view;
}
void StartNewActivity(object sender, EventArgs e)
{
Intent intent = new Intent(this.Activity, typeof(Activity1));
this.StartActivity(intent);
var trans = this.FragmentManager.BeginTransaction();
trans.SetCustomAnimations(Resource.Animation.BounceTop, Resource.Animation.Slide_out, Resource.Animation.BounceTop, Resource.Animation.Slide_out);
trans.AddToBackStack(null);
trans.Commit();
}
}
}
活动:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
namespace TabbedApp
{
[Activity(Label = "Activity1")]
public class Activity1 : Activity
{
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.layout1);
}
}
}