zoukankan      html  css  js  c++  java
  • Xamarin 添加Activity 页面的坑

    前言 1、AndroidStudio添加页面时,同时增加了 Activity (代码页) Layout(布局页) 2、Xamarin 添加时是分开添加的所以遇到问题 遇到的问题如下: Android.Content.ActivityNotFoundException: 'Unable to find explicit activity class {com.companyname.app2/crc64bb1b55f618e11607.layout1}; have you declared this activity in your AndroidManifest.xml 1、 public class layout1: Activity //这里应该要设置为public 2、类名上增加说明:如下 [Activity(Name = "com.companyname.app2.layout1")] public class layout1: Activity 3、 布局和代码关联关键代码 (代码页) protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); Xamarin.Essentials.Platform.Init(this, bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.layout1); //关联代码 }
  • 相关阅读:
    uva 1637 Double Patience
    Emacs ^ Vim
    uva 11181 Probability|Given
    uva 10491 Cows and Cars
    uva 1636 Headshot
    hdu 4336 Card Collector
    zoj 3640 Help Me Escape
    Codeforces 148 D Bag of mice
    hdu 4405 Aeroplane chess
    hdu 3853 LOOPS
  • 原文地址:https://www.cnblogs.com/mycls/p/14961928.html
Copyright © 2011-2022 走看看