ios - Xcode - Adding constraints to UITableView so that it fits all screen sizes -


i've read quite few tutorials , watched numerous videos on using constraints in xcode. reason, i'm still missing aspects necessary make user interface way it's supposed screen sizes.

currently, have uitableview laying on view controller. view controller set "inferred" size , have of different sized devices open in assistant editor preview right can view changes. i've encountered multiple problems attempting constraints correct different screen sizes.

problem 1: uitableview has width set 600. causes dead space right of table view on ipad preview , causes uitableview extend far on smaller devices. if make width of table view smaller fits within preview of screen sizes , pin left , right edges of table view edge of superview specifying 0 , unchecking constrain margins, result i'm seeing in preview entire table view disappears each device size. surprised because thought pinning table view margins, make table view fit within each of screens.

problem 2: (this different scenario problem 1, above.) in situation, i've left size of table view 600 , specified constraints internal components of cell contained within tableview. in case, table view still not wide enough ipad dimensions , extends far on smaller devices makes components in cells truncated , off of center.

i've been working in storyboard width, height set. however, if change setting compact width, height, can alter constraints fit smaller devices little better, there's still problem getting things work between 5.5 inch screen , smaller devices.

i uitableview extend way edges on each device , have view inside of cell remain centered , keep it's relative size on each of devices. have suggestions on how can accomplish this?

if want make tableview "fill" whole screen (device-independent) thing have pin 4 edges (top, left, bottom, right) superview (the viewcontrollers view in case) constant of 0. not specify specific width (like in case 600) or height.

good luck :)


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -