This is a migrated thread and some comments may be shown as answers.

ListViewTextCell text not vertically center aligned

3 Answers 28 Views
This is a migrated thread and some comments may be shown as answers.
Shalin
Top achievements
Rank 1
Shalin asked on 06 Feb 2019, 10:20 AM

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>

 

 

3 Answers, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 08 Feb 2019, 01:54 PM
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
0
Shalin
Top achievements
Rank 1
answered on 12 Feb 2019, 06:29 AM

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.

0
Didi
Telerik team
answered on 12 Feb 2019, 12:22 PM
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
Asked by
Shalin
Top achievements
Rank 1
Answers by
Didi
Telerik team
Shalin
Top achievements
Rank 1
Share this question
or