I have been some time working with unityUnity for some time, and I am trying to get a better understand of the UI system.
I am a mobile developer and I am redesigning the UI but I am unable to achieve what I want.
My game is in portrait mode and I have a panel. I want the panel to have a maximum width of 1080 pixels. In case thatcases where the panel doesn't fit inon the screen whenbecause the aspect ratio is less ( likelike the new iPhone X) ., I want it to shrink it a bit with a minimum width of 700 pixels. In the case that the screen is larger than 10801080p ( likelike the iPad proPro). I want the panel to have the maximum size.
VisualHere are visuals of what I want to achieve.:
Nexus 6P ( 1080x1920)
iPhone X(1125x2436)
iPad pro (2048x2732)
I have been playing with layout elementLayout Element
and content size fitterContent Size Fitter
components without good resultsuccess.
If I set the min width size to 700 pixels and preferred size to 1080 pixels nothing happenhappens (even playing withafter setting flexible width.)
If I set the content size fitter. If I chooseContent Size Fitter
to the preferred size it just get always reverts to the preferred size and. The same thing happens with min.
How do these elements workscomponents work, and how I can achieve the desired effect?
Canvas configuration: