xcode - Creating UI element won't let change position -



xcode - Creating UI element won't let change position -

i tried this:

@ibaction func test(sender : anyobject){ allow height:cgfloat = 44 var tableframe:cgrect = tableview.frame; var fieldframe = cgrect() fieldframe.origin = tableframe.origin fieldframe.size.height = height fieldframe.size.width = tableframe.size.width var textfield = uitextfield(frame: fieldframe) textfield.backgroundcolor = uicolor(white: 0, alpha: 1) view.addsubview(textfield) tableframe.size.height = tableframe.size.height - height tableframe.origin.y = tableframe.origin.y + height tableview.frame = tableframe }

when running, black field appears, table won't move nor alter size. removing line

view.addsubview(textfield)

allows table alter size , move, but, obviously, no field appears. problem?

your textfield on top of tableview. touch actions going text fieldview , not tableview

xcode swift

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -