ANS*_*LAR 8 c# android xamarin
这是main.axml文件.
`<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="25px"
android:minHeight="25px">
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/myListView" />
</LinearLayout>`
Run Code Online (Sandbox Code Playgroud)
这是MainActivity.cs文件:
protected override void OnCreate(Bundle bundle){base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
Glop = new List<string>();
Glop.Add("Tom");
Glop.Add("Dick");
Glop.Add("Harry");
Name = FindViewById<ListView>(Resource.Id.myListView);
}
Run Code Online (Sandbox Code Playgroud)
我正在尝试在Xamarin Android中创建Listview.
我已经将android Id更改为myListView,并且还尝试重建应用程序,但它仍显示为错误.我现在应该怎么做 ?
Sei*_*eld 15
尝试再次重建应用程序并保存main.axml文件.
对于Visual Studio Community 2019预览版(V 16.0.0,Pr 5.0):
对于这个问题以及设计人员的很多问题,我必须重复执行以下操作:
使用此版本(允许的版本,它仍然是beta),在设计器处于打开状态的情况下在项目上干净运行会导致访问许可错误,可以通过以下步骤进行更正。
| 归档时间: |
|
| 查看次数: |
20024 次 |
| 最近记录: |