UISlider height not adjusting correctly

落爺英雄遲暮 提交于 2019-12-11 19:13:27

问题


I'm building a UI for a video player and trying to make sure it looks good on all devices (from iPad Pro down to iPhone SE)

Unfortunately I'm having trouble with the dynamic sizing of particular elements. Specifically the UISlider and UILabel. For this question specifically I've hidden the UILabel to focus on the UISlider.

Here is my setup in the Interface Builder in Xcode:

The relevant portion is the constraint:

Seek Bar.height = 0.1 x height

This should set the UISlider at the bottom of the UI to be exactly 1/10th of the full size of the View, regardless of screen size.

When I load this up on an iPad it looks fine. But when I load it up on an iPhone SE, I get the following:

The seek bar is HUGE! Nearly 1/4th the height of the entire View. What am I doing wrong? Am I misunderstanding something about how UISliders are sized?

来源:https://stackoverflow.com/questions/58013924/uislider-height-not-adjusting-correctly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!