0
問題があります。 ListViewで選択した項目の後にstacklayoutのラベルに情報を表示したいのですが、xamarinの背後にあるコードで自分の参照が見えないため、x:Stackの名前を使用できません。それはリストビューの項目テンプレートであるので、それはdynamicly生成されるので、あなたが要素More
を見ることができないXamarin.Forms StackLayout ListViewで選択した項目の後にIsEnabledを設定します。
<ListView x:Name="ChallengeList" SeparatorColor="#3d122c" HasUnevenRows="True"
ItemSelected="ChallengeList_ItemSelected" RelativeLayout.YConstraint="{ConstraintExpression ElementName=Lab, Constant=0,Factor=1,Property=Height,Type=RelativeToView}"
RelativeLayout.HeightConstraint="{ConstraintExpression Property=Height,Factor=0.8,Type=RelativeToParent}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Horizontal" BackgroundColor="#40FFFFFF" Padding="10">
<StackLayout HorizontalOptions="CenterAndExpand">
<Label Text="{Binding Title}" TextColor="#ff3f50" FontSize="17" FontAttributes="Bold" HorizontalOptions="Center"/>
<StackLayout HorizontalOptions="CenterAndExpand" IsEnabled="False" x:Name="More" >
<Label Text="sdfghjkhgfdsfghjkljhgfdsadfghjkljhgfdsaSDFGHJKJHGFDSAsdfghjkhgfds" TextColor="#ff3f50" FontSize="17" FontAttributes="Bold" HorizontalOptions="Center"
LineBreakMode="WordWrap"/>
</StackLayout>
</StackLayout>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
その –
なぜ動作しませんか?何も情報を提供しないと、助けが難しいです。 – Kedrzu
現在のコンテキストには存在しませんが、私は新しいオブジェクトを作成し、エラーは消えました。私はIsEnabledはまだ真であると思う。なぜなら、私がappレイアウトを開始するとlistviewでenalbedされるからだ。 –