Centering LoadOnDemandItemTemplate

2 posts, 0 answers
  1. Mikhail
    Mikhail avatar
    16 posts
    Member since:
    Jul 2017

    Posted 07 Nov 2017 Link to this post

    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>
  2. Lance | Manager Technical Support
    Admin
    Lance | Manager Technical Support avatar
    1168 posts

    Posted 09 Nov 2017 Link to this post

    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
Back to Top