RadButton: HorizontalContentAlignment = Start on iOS without padding

11 posts, 0 answers
  1. Daniel
    Daniel avatar
    11 posts
    Member since:
    Dec 2017

    Posted 15 Feb 2018 Link to this post

    When setting HorizontalContentAlignment to Start, the RadButton looks alright on UWP and Android. The title is left aligned with decent spacing to the border. However, on iOS there is no padding to the left. Is it possible to have a spacing here? 
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1251 posts

    Posted 19 Feb 2018 Link to this post

    Hello Daniel,

    Yes. You can control the spacing using the Padding property of the button. You can set it per your needs for iOS only. The reason behind this behavior is the fact that in iOS when you set the content to be left aligned, the content (the Text of the button) actually goes to the most left of its container (the RadButton). To compensate for this behavior, you can set left padding of 8. 

    Please give this a try and let us know if it works for you.

    Regards,
    Pavel R. Pavlov
    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. Daniel
    Daniel avatar
    11 posts
    Member since:
    Dec 2017

    Posted 19 Feb 2018 in reply to Pavel R. Pavlov Link to this post

    Hi Pavel,

    unfortunately, using Padding is not working for me. The title has no spacing to the left.

    I am using iOS 11 Simulator and Telerik Xamarin Forms 2018.1.117.5.

    Best regards,

    Daniel

  4. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1251 posts

    Posted 21 Feb 2018 Link to this post

    Hi Daniel,

    Thank you for providing additional information regarding this behavior. We confirm that the Padding is not working as expected in iOS. This is why we logged a bug in our feedback portal. Providing a fix is scheduled for our 2018 R2 official release. We aim to release at the beginning of May. Is this timeframe good enough for you? If not we could provide a workaround to be used till our official release is available.

    Regards,
    Pavel R. Pavlov
    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
  5. Daniel
    Daniel avatar
    11 posts
    Member since:
    Dec 2017

    Posted 21 Feb 2018 in reply to Pavel R. Pavlov Link to this post

    > We aim to release at the beginning of May. Is this timeframe good enough for you?

    Yes, that should be alright. Looking forward to the 2018 R2 release :-)

  6. Stavros
    Stavros avatar
    18 posts
    Member since:
    Oct 2017

    Posted 04 Oct 2018 Link to this post

    I experienced the same bug iOS 12.0 with 3.2 Xamarin.Forms and Telerik 2018.3.912.1 .

    Padding isn't working as expected in iOS simulator.

  7. Didi
    Admin
    Didi avatar
    230 posts

    Posted 05 Oct 2018 Link to this post

    Hi Stavros,

    I have tried to reproduce the described behavior but on my side it works fine. Could you please elaborate more on issue you have observed and how the padding of the Button is not working? Please take a look at the attached project and may I ask you to modify it according to your specific setup and send it back to me? In order to attach a project you should open a support ticket because in the forum only image attachments are allowed. 

    Alternatively, if you could provide some code snippet or an image demonstrating the issue, that would be of help as well.

    Looking forward to your reply.

    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
  8. Stavros
    Stavros avatar
    18 posts
    Member since:
    Oct 2017

    Posted 10 Oct 2018 Link to this post

    Sorry, I didn't write it properly. I have an issue with iOS and the Padding. Not with the HorizontalContentAlignment . 

    The padding seems not working at all. 
  9. Didi
    Admin
    Didi avatar
    230 posts

    Posted 11 Oct 2018 Link to this post

    Hi Stavros,

    Thank you for the attached screenshot.

    I have noticed form the attached image that the button does not have padding left and right. Please take a look at the following snippet below how the RadButton is defined:

    <StackLayout>
            <telerikInput:RadButton x:Name="button"
                            HorizontalContentAlignment="Start"
                            Text="Click me!" 
                            BorderThickness="2"
                            BorderColor="#4488F6"
                            Clicked="button_Clicked"/>
    </StackLayout>

    When HorizontalTextAlignment is applied to Start, the Button has left padding. Could you please send me how the RadButton is defined in your specific setup? In this way I could investigate it further.

    Looking forward to your reply.

    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
  10. Stavros
    Stavros avatar
    18 posts
    Member since:
    Oct 2017

    Posted 11 Oct 2018 in reply to Didi Link to this post

    <telerik:RadButton x:Name="btnPrev1"
                                  Text="Previous"
                                  Clicked="Previous_Clicked" 
                                  HorizontalContentAlignment="Center" 
                                  Padding="10,0"
     />

  11. Didi
    Admin
    Didi avatar
    230 posts

    Posted 12 Oct 2018 Link to this post

    Hi Stavros,

    Thank you for the provided code.

    I have tested it and I reproduced the issue when the parent element is horizontal oriented and the RadButton padding is horizontal oriented the button padding is not applied on iOS. I have logged this in our Feedback portal and you could follow the item on the provided link: Button: [iOS] Padding does not respect horizontal options. Currently, the workaround I could suggest is using RadBorder control with padding and the border should be wrapped around a Button. Here is an example how this could be achieved:

    <StackLayout>
            <telerikPrimitives:RadBorder BorderColor="#4488F6"
                                HeightRequest="100"
                                WidthRequest="100"
                                HorizontalOptions="Center"
                                CornerRadius="5"
                                Padding="10,0"
                                BackgroundColor="AliceBlue">
                <telerikInput:RadButton Text="Hello there" TextColor="Black" BackgroundColor="Coral"/>
            </telerikPrimitives:RadBorder>
    </StackLayout>

    You can also find your Telerik points updated for this report.

    Let me know if you have any other 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