Thursday 15 August 2013

ios - Change width of UISearchBar -



ios - Change width of UISearchBar -

i'm having hamburger menu i'm showing viewcontroller tableview. problem i've added uisearchbar titleview , u can see searchbar hiding. there way i' can create navigationbar smaller or searchbar fit ?

searchbar = uisearchbar(frame: cgrectmake(0, 0, self.revealviewcontroller().rearviewrevealwidth-30, 44)) searchbar?.delegate = self searchbar?.showscancelbutton = false var textfield = searchbar?.valueforkey("searchfield") uitextfield textfield.backgroundcolor = uicolor(rgba: "#414e5c") textfield.leftviewmode = uitextfieldviewmode.never textfield.layer.cornerradius = 5 textfield.clipstobounds = true searchbar?.placeholder = "søg efter produkter" searchbar?.setpositionadjustment(uioffsetmake(0, 0), forsearchbaricon: uisearchbaricon.search) textfield.borderstyle = uitextborderstyle.none searchcontroller = uisearchdisplaycontroller() searchcontroller?.delegate = self searchcontroller?.searchresultsdelegate = self var buttonsearchbar:uibarbuttonitem = uibarbuttonitem(customview: searchbar!) self.navigationitem.leftbarbuttonitem = buttonsearchbar

ios objective-c iphone swift uinavigationbar

No comments:

Post a Comment