swift - Map view getting shrunk in Dynamic table view cell -
in swift ios app, have tableview in viewcontroller 2 prototype cells. 1 cell has 2 text boxes (cell) , other cell has 1 uiview (mapview in mapcell) in have display google map view location markers. have set leading,trailling , top , bottom constraints things in cell. also, included following dynamic cells.
chatmessagestableview.rowheight = uitableviewautomaticdimension chatmessagestableview.estimatedrowheight = 100
first cell gets dynamic height depending upon content size, mapcell shrunken, tried lot of things , nothing helping, please suggest can more. here related code , tableview cell image.
let cell = tableview.dequeuereusablecell(withidentifier: "mapcell", for: indexpath) as! tableviewcell googlemapview.frame = cgrect(x: 0, y: 0, width: 400, height: 300) let camera = gmscameraposition.camera(withlatitude:self.triplocation.latitude, longitude: self.triplocation.longitude, zoom: 15) googlemapview.animate(to: camera) cell.mapview.addsubview(googlemapview) cell.mapview.sizetofit() cell.updateconstraints() cell.updateconstraintsifneeded()
one more problem when scroll down table, next cells gets messed constraints , ex, text alignment! please me solve this. reading lot of tutorials on constraints , layout, nothing working out!
Comments
Post a Comment