Search code examples
iosswiftuitableviewwidgetballoon

How to create a UiTableView of balloons like iOS widgets - Swift 3/Xcode 8


I want to create a list of events in my application and I think this would be a perfect look, but I have no idea how to do it.
Can anybody help me?
Thanks!!

enter image description here


Solution

  • Check out the following method 1) in the interface builder drag a new UITableViewCell 2) Set the contentView and background of tableview to UIColor.clear / UIColor.clearColor();

    2) dragIn a view and adjust the size as per requirement (This will act as container View i.e the bigger balloon) 3) now select background colour to white and change opacity to 85 - 90 % this will give you the desired color

    4) Add Label o top and select the same background colour and the opacity as 50 % as main view and as there is a difference in opacity of 2 containers you will get the desired effect

    5) Connect an outlet connection of the mainView and Label

    6) set corner radius to view and and label

    self.mainView.layer.cornerRadius = 10; // or anything as per requirement
    

    AND

    self.label.layer.cornerRadius = 10; // run it now to adjust the corner radius