This is a migrated thread and some comments may be shown as answers.

Rad Calendar Swipe issue

11 Answers 51 Views
Calendar - Xamarin.iOS
This is a migrated thread and some comments may be shown as answers.
snr
Top achievements
Rank 1
snr asked on 14 Dec 2017, 01:59 PM

Currently for Calendar swipe is happening left or right , i want to add up and down swipe instead of left and right?

How can  i achieve this?

 

Thanks in advance,

Siva

11 Answers, 1 is accepted

Sort by
0
snr
Top achievements
Rank 1
answered on 15 Dec 2017, 05:27 AM

i want add some info to my earlier post,

For IOS i want to add up and down swipe, currently it is using left and right swipe.

Thanks,

Siva

 

 

0
Nikolay
Telerik team
answered on 19 Dec 2017, 09:15 AM
Hello,

The iOS calendar supports several transitions to switch between months. To change the orientation of the default transition you need to set the TransitionIsVertical property of the TKCalendarMonthPresenter to true. Here is a simple code snipped of how you can achieve this:

var calendarPresenter = calendarView.Presenter as TKCalendarMonthPresenter;
if (calendarPresenter != null)
{
    calendarPresenter.TransitionIsVertical = true;
}

You can find more information about the calendar transitions in our documentation - link

I hope I've been helpful.
 
Regards,
Nikolay
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
0
akhil
Top achievements
Rank 1
answered on 12 Apr 2018, 01:10 PM

Hi,

I am using RadCalendar in Xamarin forms, I want the calendar transition as vertical for the month view. Is it possible to get vertical scroll transition in Xamarin forms using RadCalendar?

The control reference is here: https://docs.telerik.com/devtools/xamarin/controls/calendar/calendar-overview

Please suggest.

 

 

0
Lance | Manager Technical Support
Telerik team
answered on 12 Apr 2018, 04:21 PM
Hello Akhil,

Nikolay's code snippet shows how to change the scrolling direction of the calendar. Since you're using Xamarin.Forms and the TransitionIsVertical property is on the native iOS TKCalendar control, you'll need to set it using a Xamarin Custom Renderer or Xamarin Effect.

Custom Renderer

You can see an example in the RadCalendar's iOS Custom Renderer article.

Note that because Customer Renderers are a general Xamarin.Forms topic and not directly related to the UI for Xamarin feature, we do not have documentation for it. However, you can find a in-depth tutorials and walk-throughs in the Xamarin Custom Renderer documentation.

Effect

You could also use a Xamarin Effect to access the native control's properties, see the Creating an Effect Xamarin.Forms documentation for more information and how to get started.

Once you've set up your Effect classes, you could use the OnAttached method of the Effect to set the value:

[assembly: ResolutionGroupName("MyCompanyName")]
[assembly: ExportEffect(typeof(ScrollDirectionEffect), "ScrollDirectionEffect")]
namespace CalendarWithXamarinEffect.iOS.Effects
{
    public class ScrollDirectionEffect : PlatformEffect
    {
        protected override void OnAttached()
        {
            try
            {
                var tkCalendar = Control as TKCalendar;
 
                if (tkCalendar?.Presenter is TKCalendarMonthPresenter calendarPresenter)
                {
                    calendarPresenter.TransitionIsVertical = true;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Cannot set property on attached control. Error: ", ex.Message);
            }
        }
 
        protected override void OnDetached()
        {
            // not used
        }
    }
}


and eventually in the Xamarin.Forms app, you can use the effect:

<telerikInput:RadCalendar x:Name="calendar">
    <telerikInput:RadCalendar.Effects>
        <effects:ScrollDirectionEffect />
    </telerikInput:RadCalendar.Effects>
</telerikInput:RadCalendar>


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
0
akhil
Top achievements
Rank 1
answered on 17 Apr 2018, 08:58 AM

Thanks Lance for the solution. Its working as expected now.

I just want to ask one more question, please suggest.

In xamarin forms RadCalendar, I want to customize the selected cell, I mean by default the selected date displays as a highlighted with a blue colored circle but instead of circle, I want it to be get highlighted with some another color and shape. For example: The selected date should be display as a rectange instead of circle and its color should be green instead of blue. I want this customization for IOS platform only.

 

 

 

 

 

 

0
akhil
Top achievements
Rank 1
answered on 17 Apr 2018, 10:38 AM
Also Lance, Is it possible to display days as single character. For example Sunday as "S" instead of "Sun"? Please suggest
0
akhil
Top achievements
Rank 1
answered on 17 Apr 2018, 11:48 AM

Attached Image is for the reference.

Looking for the similar output.

0
Lance | Manager Technical Support
Telerik team
answered on 17 Apr 2018, 07:41 PM
Hi akhil,

Take a look at the iOS Custom Renderer article for how to access the native calendar to apply custom styling. Additionally, the native iOS Calendar customization article to see how to access certain parts of the control. Lastly, you can look at examples of the RadCalendar and TKCalendarView in the Developer Focused Examples.

As far as implementing your specific requests, you can reach out to our Custom App / Custom Development partners to get assistance with your custom styling requirements.

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
0
Lance | Manager Technical Support
Telerik team
answered on 17 Apr 2018, 07:53 PM
Hello Akhil,

I wanted to follow up with you to show you where to look in the SDKBrowser demo to find the custom renderer that configures the cell styles. Here's a screenshot to guide you:



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
0
John
Top achievements
Rank 1
answered on 05 Jul 2019, 08:53 PM

Sorry to hijack this thread, but I need the same for Android.  I need the calendar to scroll left to right, not up and down.  Can you help with an Effect, or at least the properties in the native control that I would need to set?

Thank you.

0
John
Top achievements
Rank 1
answered on 07 Jul 2019, 06:38 PM

I have found the documentation on the Android Custom Renderers and Android Native control information and have what I need.  

Thank you.

Tags
Calendar - Xamarin.iOS
Asked by
snr
Top achievements
Rank 1
Answers by
snr
Top achievements
Rank 1
Nikolay
Telerik team
akhil
Top achievements
Rank 1
Lance | Manager Technical Support
Telerik team
John
Top achievements
Rank 1
Share this question
or