c# - 如何运行Main.axml?

标签 c# android mobile xamarin emulation

你好,我在 Visual Studio 2015 上安装了 Xamarin
并且想要创建一个 Android 应用程序。

我想运行此页面上的步骤:https://msdn.microsoft.com/en-us/library/mt488769.aspx
(文件新项目/模板/Visual C#/跨平台/空白应用程序( native 可移植))

当我调试这个空白项目时,
此窗口在启动时打开:
default window


但我想运行位于 Reources/layout

的下面的窗口 (Main.axml)

wanted window

我错过了什么?
提前致谢。

最佳答案

    public class MainActivity : Activity
{
    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);

        // Set our view from the "main" layout resource
        SetContentView(Resource.Layout.Main);
    }

}

检查线路

SetContentView(Resource.Layout.Main);

关于c# - 如何运行Main.axml?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36426889/

相关文章:

c# - 从 List<> 中删除重复的项目并记录重复的数量

c# - 默认构造函数是必需的吗?

android - 从 NFC 标签读取数据 (IsoDep)

Android:AlertDialog 未在 Cancel() 或 Dismiss() 上关闭

方向更改后的 javascript 最大视口(viewport)高度 Android 和 iOS

javascript - 将详细信息按钮添加到动态 HTML 列表

c# - "Too many characters in character literal error"

php - JSONException : Value of type java. lang.String 无法转换为 JSONObject

javascript - 滚动子 iframe 时接收 touchmove 事件

jquery - iPhone 移动 Safari : Force keyboard open