swift - How to get search bar background transparant?(see image) -


i using searchcontroller in view, can not rid of annoying background of searchbar.

the code using:

import uikit  class systemtable: uitableviewcontroller, uisearchbardelegate , uisearchresultsupdating{  @iboutlet var systemtable: uitableview! var searchcontroller = uisearchcontroller()   override func viewdidload() {     super.viewdidload()      self.searchcontroller = ({         let controller = uisearchcontroller(searchresultscontroller: nil)         controller.searchresultsupdater = self         controller.searchbar.sizetofit()         controller.searchbar.delegate = self         controller.searchbar.bartintcolor = uicolor.lightgraycolor()         controller.searchbar.translucent = true         controller.searchbar.alpha = 1          controller.searchbar.backgroundcolor = uicolor.clearcolor()         controller.searchbar.layer.opacity = 1         self.tableview.tableheaderview = controller.searchbar         return controller     })()   } 

image: enter image description here

to clear: want rid of background colored gray in image above.

any appreciated

@@@@@@@@@@@@@@@@@enter image description here edit @@@@@@@@@@@@@@@@@ new image(when trying scrolling down):

enter image description here

its working fine me, sure r close solution. try somewhere u r missing.

here code

 searchcontroller.searchbar.translucent = true     searchcontroller.searchbar.alpha = 1     searchcontroller.searchbar.backgroundimage = uiimage()     searchcontroller.searchbar.bartintcolor = uicolor. clearcolor() 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -