iOS month calendar week number cell width increase

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

    Posted 31 May 2019 Link to this post

    hi,

    i need to increase week number font size and weight. that is done using following code, inside CalendarDelegate UpdateVisualsForCell

    weekNumberCell.Label.AdjustsFontSizeToFitWidth = true;
    weekNumberCell.Style.TextFont = weekNumberCell.Label.Font.WithSize(16);
    weekNumberCell.Style.TextFont = UIFont.BoldSystemFontOfSize(16);

     

    since week number cell width or label width can not increase, font size automatically get reduce.

    i need a way to increase week number cell width or automatically increase according to text in it.

     

  2. Answer
    Yana
    Admin
    Yana avatar
    5044 posts

    Posted 03 Jun 2019 Link to this post

    Hello Shalin,

    You would also need to access the TKCalendarMonthPresenter in the renderer and through its Style set WeekNumberCellWidth property to the needed width value. Please check the snippet below for the exact approach:

    public class CustomCalendarRenderer : CalendarRenderer
    {
        protected override void OnElementChanged(ElementChangedEventArgs<RadCalendar> e)
        {
            base.OnElementChanged(e);
            if (Control.Presenter is TKCalendarMonthPresenter)
            {
                (Control.Presenter as TKCalendarMonthPresenter).Style.WeekNumberCellWidth = 50;
            }
        }
     
        ...
    }

    I hope I was of help.

    Regards,
    Yana
    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