【问题标题】:table view section background color xamarin android表格视图部分背景颜色 xamarin android
【发布时间】:2017-04-10 23:38:16
【问题描述】:

我正在开发一个以 xamarin 形式 (xaml/c#) 的新应用程序。我在 xaml 页面中有一个带有标题的表格视图部分的表格视图。我怎样才能改变只有表格部分的背景颜色?我可以在所有表​​格视图中更改它,但我只想更改表格部分的颜色。我是开发新手,有简单的解决方案吗?谢谢你

【问题讨论】:

    标签: android xaml xamarin tableview


    【解决方案1】:

    这里是 XAML 解决方案(背景部分):

    <ListView.GroupHeaderTemplate>
                <DataTemplate>
                    <ViewCell>
                        <StackLayout VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" BackgroundColor="Silver">
                            <Grid Padding="5" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
                                <Label Text="{Binding Title}" 
                                FontSize="Medium" 
                                FontAttributes="Bold" 
                                TextColor="Black" 
                                VerticalOptions="CenterAndExpand" 
                                LineBreakMode="WordWrap"
                                BackgroundColor="Red"
                            />
                            </Grid>
                        </StackLayout>
                    </ViewCell>
                </DataTemplate>
            </ListView.GroupHeaderTemplate>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-17
      • 2011-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-28
      • 1970-01-01
      相关资源
      最近更新 更多