방금 첫 번째 안드로이드 앱을 만들 때 xamarin을 사용하기 시작했으며 작은 문제가 있습니다.Xamarin - 안드로이드 - 스플래쉬 스크린 (복수)
앱 시작 부분에 2 개의 시작 화면을 넣고 싶습니다.
나는 잘 작동하는 첫 번째 작품을 만든 다음 두 번째 작품 인 mainActivity를 만들었습니다.
그러나 어떤 이유로 인해 두 번째 시작 화면이 표시되지 않습니다.
두 번째 줄에서이 줄을 제거하면 작동하지만 mainActivity로 이동하지 않습니다.
StartActivity(typeof(MainActivity));
MainActivity.cs
[Activity(Theme = "@style/Theme.Splash1", MainLauncher = true, NoHistory = true)]
public class SplashActivity1 : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
Thread.Sleep(3000);
StartActivity(typeof(SplashActivity2));
}
};
[Activity(Theme = "@style/Theme.Splash2", NoHistory = true)]
public class SplashActivity2 : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
Thread.Sleep(3000);
StartActivity(typeof(MainActivity));
}
};
[Activity (Label = "coco1_droid", Icon = "@drawable/icon")]
public class MainActivity : Activity
{
int count = 1;
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
// Set our view from the "main" layout resource
SetContentView (Resource.Layout.Main);
// Get our button from the layout resource,
// and attach an event to it
Button button = FindViewById<Button> (Resource.Id.myButton);
button.Click += delegate {
button.Text = string.Format ("{0} clicks!", count++);
};
}
}
을이 훌륭한 답변입니다. 친구를 공유해 주셔서 감사합니다. @ 지미 -이 대답을 +1하고 대답으로 표시하십시오. –