SideDrawer blocking touch events to subviews

5 posts, 0 answers
  1. Armando
    Armando avatar
    4 posts
    Member since:
    Nov 2015

    Posted 17 Nov 2015 Link to this post

    I have a ViewController that has a TKChart (a line area series) with the trackball enabled. When i add a SideDrawer to this ViewController i can no longer use the trackball since the SideDrawer is getting all the touch events even when it is hidden. Is there a way to configure the SideDrawer to pass the touch events to the other subviews?.

     Thanks.

  2. Adrian
    Admin
    Adrian avatar
    167 posts

    Posted 17 Nov 2015 Link to this post

    Hi, Armando,

    Thank you for contacting us.

    To use the chart's trackball and also have a TKSideDrawer in the view controller you should create a TKSideDrawerView which has a mainView property. You should use the mainView as a parent view for the content below the side drawer. This way the gestures should work as desired. Please consider the code snippet below:
    _sideDrawerView = [[TKSideDrawerView alloc] initWithFrame:self.view.bounds];
    [self.view addSubview:_sideDrawerView];
         
    _chart = [[TKChart alloc] initWithFrame:self.view.bounds];
    [_sideDrawerView.mainView addSubview:_chart];

    I hope this helps. Should you have further questions, do not hesitate to contact us.

    Regards,
    Adrian
    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. DevCraft banner
  4. Armando
    Armando avatar
    4 posts
    Member since:
    Nov 2015

    Posted 17 Nov 2015 Link to this post

    Thank you this solved my problem.
  5. Adrian
    Admin
    Adrian avatar
    167 posts

    Posted 18 Nov 2015 Link to this post

    Hi, Armando,

    I am glad that I could help. In case you need further assistance, do not hesitate to write again.

    Regards,
    Adrian
    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
  6. Sam
    Sam avatar
    12 posts
    Member since:
    Sep 2015

    Posted 14 Feb Link to this post

    Thanks! Had this same problem as well. For noobs like myself this is what I did in swift based off of Adrians answer:

    self.sideDrawerView = TKSideDrawerView(frame: self.view.bounds)self.view!.addSubview(sideDrawerView)
    self.chart = TKChart(frame: self.view.bounds)
    sideDrawerView!.mainView.addSubview(chart)

Back to Top
DevCraft banner