2016-04-25 9 views
0

AndroidおよびIOS用のXamarinフォームでListViewをデザインしたいと考えています。Xamarinフォームのリストビューアイテム(ラベル+円背景)

私はこの項目のリストを作りたい:enter image description here

私の問題は、数の円です。実際、私はXamarinフォームでサークルを作る方法がわかりません。

これは私のItemTemplateにある:

<ViewCell.View> 
<StackLayout HorizontalOptions="FillAndExpand" Padding="10" BackgroundColor="{Binding RowColor}"> 
    <Label Text="{Binding Name}" TextColor="White" FontSize="20" 
      LineBreakMode="NoWrap" /> 
    <Grid HorizontalOptions="FillAndExpand"> 
     <Grid.ColumnDefinitions> 
      <ColumnDefinition Width="4*" /> 
      <ColumnDefinition Width="1*" /> 
     </Grid.ColumnDefinitions> 
     <Label Text="{Binding BarcodeMessage}" Grid.Column="0" 
       HorizontalOptions="FillAndExpand" TextColor="White" /> 
     <Label Text="{Binding Quantity}" Grid.Column="1" 
       HorizontalOptions="FillAndExpand" TextColor="White" /> 
    </Grid> 
</StackLayout> 

あなたは私を助けることができますか?

+0

ここにチェックしましたか?:http://stackoverflow.com/questions/25366718/circled-label-xamarin-forms –

答えて

1

は、その中にテキストを配置、その後、背景画像として円でラベルを使用してください、ありがとうございました。グリッドでは、上にレイヤーを重ねたラベル(透明な背景)を持つImageコントロールを使用することもできます。

有用なかもしれないRoundedBoxViewプラグインもあります。

+0

Hum!私は画像を置く必要があります、私はXamarinはサークルを行うためのコントロールがありません? –

+0

RoundedBoxViewプラグインもあります - 私の編集を見てください – Jason

関連する問題