首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >X:名称属性值在代码隐藏中不可用

X:名称属性值在代码隐藏中不可用
EN

Stack Overflow用户
提问于 2017-02-26 04:05:13
回答 1查看 2.5K关注 0票数 1

我试图在后台代码中引用listView,但Visual Studio根本看不到它。下面是我的代码:

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Practice11.Views.ProfilePage"
             xmlns:circleImage="clr-namespace:ImageCircle.Forms.Plugin.Abstractions;assembly=ImageCircle.Forms.Plugin.Abstractions">
  <ListView x:Name="listView">
    <DataTemplate>
      <ViewCell>
        <StackLayout Orientation="Horizontal" Padding="10">
          <circleImage:CircleImage x:Name="image" VerticalOptions="Center"/>
          <Label Text="{Binding Description}" HorizontalOptions="StartAndExpand"/>
        </StackLayout>
      </ViewCell>
    </DataTemplate>
  </ListView>
</ContentPage>

一切都会好起来的。我从来没有经历过这样的事情。我已经尝试重新构建项目并重新启动Visual Studio,但这些都不起作用。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-02-26 04:15:08

我不知道这是否是您问题的原因,但我认为您可能错过了<ListView><DataTemplate>之间的<ListView.ItemTemplate>

编辑:另外,根据下面粘贴的截图,您需要将x:Class属性值更改为"Practice11.Views.ActivitiesPage“才能使其正常工作。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42460996

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档