guu*_*ril 1 android visual-studio xamarin
我想在按下按钮的同时打开一个新页面,但我不知道这是如何工作的(因为我是 xaramin(android) 编程的新手)我在互联网/其他 stackoverflow 论坛上几乎找不到任何东西。
当我按下@id button1 时,它应该导航到页面 settings.axml (Resource.Layout.settings.axml)
我尝试了很多不同的东西,但没有一个真正适合我。
提前致谢。(我很欣赏任何提示!)
PS:使用 Xaramin.Android
如果您使用 Xamarin.Android
Button button = FindViewById<Button>(Resource.Id.button1);
button.Click += delegate { StartActivity(typeof(settings)) };
Run Code Online (Sandbox Code Playgroud)
如果您使用 xamarin.Forms
private void button1Click(object sender, EventArgs e)
{
App.Current.MainPage = new settings();
}
Run Code Online (Sandbox Code Playgroud)
https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/navigation/hierarchical/
| 归档时间: |
|
| 查看次数: |
6784 次 |
| 最近记录: |