This is a migrated thread and some comments may be shown as answers.
iOS month calendar week number cell width increase
1 Answer 14 Views
This is a migrated thread and some comments may be shown as answers.
Shalin
Top achievements
Rank 1
Shalin asked on 31 May 2019, 09:15 AM

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.

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 03 Jun 2019, 01:02 PM
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
Asked by
Shalin
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or