ListViewTextCell text not vertically center aligned

4 posts, 0 answers
  1. Shalin
    Shalin avatar
    61 posts
    Member since:
    May 2015

    Posted 06 Feb 2019 Link to this post

    hi,

    In RadListView, ListViewTextCell Text is not vertically center aligned in both ListViewGridLayout and ListViewLinearLayout LayoutDefinition modes. Tested in Android. list is in grid row where height is set to Auto.

    <telerikDataControls:RadListView   x:Name="EventStatusListView" 
                                                             SelectionMode="Multiple" Margin="10,0,0,0"
                                                              VerticalOptions="Fill">
                <telerikDataControls:RadListView.ItemTemplate>
                    <DataTemplate>
                        <telerikListView:ListViewTextCell Text="{Binding name}"/>
                    </DataTemplate>
                </telerikDataControls:RadListView.ItemTemplate>
                <telerikDataControls:RadListView.LayoutDefinition>
                    <telerikListView:ListViewGridLayout SpanCount="3" HorizontalItemSpacing="1" VerticalItemSpacing="1" />
                </telerikDataControls:RadListView.LayoutDefinition>
     
                <telerikDataControls:RadListView.ItemStyle>
                    <telerikListView:ListViewItemStyle BackgroundColor="Transparent"
                                                                       BorderWidth="1" TextCellTextColor="Green"
                                                                       BorderLocation="All"
                                                                       BorderColor="Gray"/>
                </telerikDataControls:RadListView.ItemStyle>
     
                <telerikDataControls:RadListView.SelectedItemStyle>
                    <telerikListView:ListViewItemStyle TextCellTextColor="White"
                                                                       BackgroundColor="DarkGreen"
                                                                       BorderLocation="All"/>
                </telerikDataControls:RadListView.SelectedItemStyle>
     
                <telerikDataControls:RadListView.PressedItemStyle>
                    <telerikListView:ListViewItemStyle TextCellTextColor="Green"
                                                                       BorderColor="Gray" BorderWidth="5" BorderLocation="All"/>
                </telerikDataControls:RadListView.PressedItemStyle>
            </telerikDataControls:RadListView>

     

     

  2. Didi
    Admin
    Didi avatar
    356 posts

    Posted 08 Feb 2019 Link to this post

    Hello Shalin,

    Thank you for the provided code.

    RadListView TextCell is used to visualize text and optionally detail text rendered as second row inside list view item. It does not provide options for alignment. In case you want to center the content in the cell you should use RadListView TemplateCell. For more details please check the following articles in our documentation how the TextCell and TemplateCell could be used.

    - ListViewTextCell

    - ListViewTemplateCell

    I hope the provided information was helpful.

    Regards,
    Didi
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Shalin
    Shalin avatar
    61 posts
    Member since:
    May 2015

    Posted 12 Feb 2019 in reply to Didi Link to this post

    hi,

    i understand TextCell text details scenario, but in iOS Text perfectly center aligned without detail text and more over if we have no detail text Text section should center aligned. Isn't it ?

    changing background and text color in ListViewTextCell is lot easier than any proposed approaches.

  4. Didi
    Admin
    Didi avatar
    356 posts

    Posted 12 Feb 2019 Link to this post

    Hi Shalin,

    I have tested the scenario when TextCell is used on Android with Text property set and I reproduced the issue with the vertically center alignment. I have logged this on your behalf in our public portal and you could follow the item on the link below:
    https://feedback.telerik.com/xamarin/1387525-listview-android-textcell-is-not-centered-vertically

    Please find your Telerik points updated for this report. Currently I could suggest you use the TemplateCell instead of a TextCell. 

    Let me know if you have any additional questions.

    Regards,
    Didi
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top