ios - UIImage overlaps with UITextField within a UIAlertController -
my code this:
let alert = uialertcontroller(title: "title", message: "alert", preferredstyle: uialertcontrollerstyle.alert) let image_view = uiimageview(frame: cgrectmake(70, 10, 200, 200)) image_view.image = uiimage(named: "logo") alert.view.addsubview(image_view) alert.addtextfieldwithconfigurationhandler { textfield in textfield.placeholder = "a textfield" alert.addtextfieldwithconfigurationhandler { textfield in textfield.placeholder = "another textfield" }
yet results in logo overlapping uitextfields. how can make sure neatly stacked 1 below other??
from point of view if create uialertcontroller
custom ui try create you're own. or if use bit hacky solution this:
let image = uiimage(named: "logo") alert.setvalue(image, forkey: "image")
Comments
Post a Comment