Problems changing background color of drawer

Thread is closed for posting
2 posts, 0 answers
  1. James
    James avatar
    16 posts
    Member since:
    Jan 2012

    Posted 01 Jun 2015 Link to this post


    I am following your examples and there is an apparent problem. I am attempting to configure my sidedrawer here.


    class DrawerContentController: UIViewController, TKSideDrawerDelegate {

        var sideDrawerView: TKSideDrawerView? = nil
        override func viewDidLoad() {

            // Do any additional setup after loading the view.
            self.view.backgroundColor = UIColor.whiteColor()
            sideDrawerView = TKSideDrawerView(frame: self.view.bounds)
            let navBar = UINavigationBar(frame: CGRectMake(0, 0, self.view.frame.size.width, 64))
            let navItem = UINavigationItem(title: "Getting Started")
            let showSideDrawerButton = UIBarButtonItem(title: "Show", style: UIBarButtonItemStyle.Plain, target: self, action: "showSideDrawer")
            navItem.leftBarButtonItem = showSideDrawerButton
            navBar.items = [navItem]
            let sideDrawer = sideDrawerView!.sideDrawer
            sideDrawer.title = "Navigation Menu"
              sideDrawer.fill = TKSolidFill(color: UIColor(red: 28 / 255.0, green: 250/255.0, blue: 241/255.0, alpha:1.5))
            sideDrawer.delegate = self
   = 80
            let sectionPrimary = sideDrawerView!.sideDrawer.addSectionWithTitle("Primary")
            let sectionLabels = sideDrawerView!.sideDrawer.addSectionWithTitle("Labels")
            sectionLabels.addItemWithTitle("Sent Mail")


        override func didReceiveMemoryWarning() {
            // Dispose of any resources that can be recreated.
        func showSideDrawer() {
        func sideDrawer(sideDrawer: TKSideDrawer!, updateVisualsForItemAtIndexPath indexPath: NSIndexPath!) {
            let section = sideDrawer.sections()[indexPath.section] as! TKSideDrawerSection
            let item = section.items()[indexPath.item] as! TKSideDrawerItem
   = UIEdgeInset


    Of particular focus to me is the background color. With this code I am still getting the default background with no changes. I am using this object as content for my drawer. I am using this object in my app delegate like so:


    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
            // Override point for customization after application launch.
            let contentController = DrawerContentController()
            let sideDrawerController = TKSideDrawerController(content: contentController)
            self.window?.rootViewController = sideDrawerController
            return true


    I just want to be able to change the background color of the drawer.

    Please assist. Thank you












  2. Jack
    Jack avatar
    2333 posts

    Posted 03 Jun 2015 Link to this post

    Hello James,

    Thank you for contacting us.

    When using SlideInOnTop transition type (which is by default) TKSideDrawer applies blur effect on its background. That is why you can't change the background in this scenario. You should set the blurType to None in order to be able to set the fill property: = TKSideDrawerBlurType.None;

    I hope this helps. Feel free to write back if you have further questions.

    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