This is a migrated thread and some comments may be shown as answers.
Centering LoadOnDemandItemTemplate
1 Answer 5 Views
This is a migrated thread and some comments may be shown as answers.
Mikhail
Top achievements
Rank 1
Mikhail asked on 08 Nov 2017, 02:51 AM

Hi,

is there a way to center text inside LoadOnDemandItemTemplate template?

The current code in the documentation produces left aligned text. Thanks

<telerikDataControls:RadListView.LoadOnDemandItemTemplate>
    <DataTemplate>
        <Grid BackgroundColor="Red">
            <Label FontSize="24"
                   HorizontalOptions="Center"
                   Text="Load more items"
                   TextColor="Black" />
        </Grid>
    </DataTemplate>
</telerikDataControls:RadListView.LoadOnDemandItemTemplate>

1 Answer, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 09 Nov 2017, 07:46 PM
Hello Mikhail,

This is working as expected on UWP and iOS. On Android the text is centered, however it's the container that is left aligned.

To confirm this is the case, I have set the HorizontalAlignment of the Label to End, and this screenshot shows the result at runtime on all 3 platforms. As you can see, by observing the red background, the parent container is left aligned on Android.

I have updated your Telerik Points for bringing this to our attention and I have logged this in our feedback portal here, you can up-vote and follow it to get notified of status changes

Unfortunately, I don't have a workaround for you because there is no access to the native control's container from the current XamarinForms API.

Regards,
Lance | Tech Support Engineer, Sr.
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
Mikhail
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Share this question
or