iOS - проблема положения нижней панели инструментов - PullRequest
0 голосов
/ 25 сентября 2019

Прежде всего, я использую раскадровку, и я новичок в Xcode, swift, iOS dev.

У меня проблема с позиционированием нижней панели инструментов на многих устройствах.На моем старом iPad и iPhone XR панель инструментов правильно расположена чуть выше вкладки.Высота панели инструментов также то, что мне нужно.

enter image description here

Но другие устройства, такие как iPhone 11 Pro Max, iPad 12,9 и более ...высота панели инструментов неправильная и / или расположение слишком велико.

enter image description here

Раскадровка выглядит следующим образом

enter image description here

Я не могу добавить какие-либо ограничения из раскадровки!

Я пытался добавить панель инструментов и сложить все кнопки в ней + добавленные ограничения,но ни одна кнопка не была показана!Это было похоже на две панели инструментов, которые находились в одном месте, одна над другой.

Я пытался добавить ограничения в viewWillAppear.

navigationController?.toolbar?.heightAnchor.constraint(equalToConstant: 25.0).isActive = true
navigationController?.toolbar?.bottomAnchor.constraint(equalTo: (tabBarController?.tabBar.topAnchor)!).isActive = true

Не удалось!

и, конечно же, в отладчике есть много ошибок ограничений!«Создайте символическую точку останова в UIViewAlertForUnsatisfiableConstraints, чтобы перехватить это в отладчике.»

|||||||• UINavigationBar: 0x143f08480

||||||||_UIBarBackground: 0x143f08ac0

|||||||||UIImageView: 0x145f0b2f0

|||||||||UIVisualEffectView: 0x145f045b0

||||||||||_UIVisualEffectBackdropView: 0x145902270

||||||||• _UINavigationBarContentView: 0x143f08e90'Jeux '

|||||||||*> layout = 0x143f08c90>

|||||||||*> layout = 0x143f08c90>

|||||||||*> layout = 0x143f08c90>

|||||||||*> layout = 0x143f08c90>

|||||||||*> layout = 0x143f08c90>

|||||||||*> layout = 0x143f08c90>

|||||||||* _UIButtonBarStackView: 0x143f916e0

||||||||||*> buttonBar = 0x28082f800>

||||||||||* _UIButtonBarButton: 0x143f95d60

|||||||||||*;слой = >>

|||||||||||* _UIModernBarButton: 0x143f96130 «Модификатор»

||||||||||||* UIButtonLabel: 0x143f97c90 'Модификатор'

|||||||||* _UIButtonBarStackView: 0x145f0b160

||||||||||*> buttonBar = 0x280834460>

||||||||||* _UIButtonBarButton: 0x145904240

|||||||||||*;слой = >>

|||||||||||* _UIModernBarButton: 0x145905910

||||||||||||* UIImageView: 0x143f06c40

|||||||||* UILabel: 0x145f06d40'Jeux '

|||||||• UIToolbar: 0x143f90830

||||||||+ _UIToolbarContentView: 0x143f875b0 - AMBIGUOUS LAYOUT для _UIToolbarContentView: 0x143f875b0.minX {id: 318}, _UIToolbarContentView: 0x143f875b0.minY {id: 322}: 320_800: 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0}

|||||||||* _UIButtonBarStackView: 0x143fb1f30 - AMBIGUOUS LAYOUT для _UIButtonBarStackView: 0x143fb1f30.Width {id: 315}, _UIButtonBarStackView: 0x143fb1f30.Height {10: 312} 1090 * 1090}|||||||||*> buttonBar = 0x28083c9a0> - AMBIGUOUS LAYOUT для UILayoutGuide: 0x28083ca80'UIViewLayoutMarginsGuide'.Width {id: 316}, UILayoutGuide: 0x28083ca80'UIViewLayoutMargid0 * 10 * 3 * 3} 93xggu||||||||||* _UIButtonBarButton: 0x143e02b90

|||||||||||*;слой = >>

|||||||||||* _UIModernBarButton: 0x143e05e70 - AMBIGUOUS LAYOUT для _UIModernBarButton: 0x143e05e70.minY {id: 404}

||||||||||||* UIImageView: 0x143e062b0- AMBIGUOUS LAYOUT для UIImageView: 0x143e062b0.minX {id: 693}, UIImageView: 0x143e062b0.minY {id: 402}, UIImageView: 0x143e062b0.W62} 400 {e0: e0: e0: e092}

||||||||||* UIView: 0x143e06470

||||||||||* _UIButtonBarButton: 0x143e06640

|||||||||||*;слой = >>

|||||||||||* _UIModernBarButton: 0x143e06810 - AMBIGUOUS LAYOUT для _UIModernBarButton: 0x143e06810.minY {id: 435}

||||||||||||* UIImageView: 0x143e07ae0- AMBIGUOUS LAYOUT для UIImageView: 0x143e07ae0.minX {id: 705}, UIImageView: 0x143e07ae0.minY {id: 433}, UIImageView: 0x143e07ae0.Width {id: 703: e0e0e0: 704: UIIe0: 0E0e0: UIIe0: 0: 700: UIIe0: UIIe0: 0II: 0IIe0: U0e0: U0e0: U0e0: E0: 700: UE: UE0: 700: UE0: 0E0: 700: U0E0: U0: 700: UE0: 0E0: 700: UE0: 700: U0: 0E0: 700: UE0: 700: UE: 704: UE: 704: UE: 704: UI: 704: UI: 704: UE: 704: UEmage0.}

||||||||||* UIView: 0x143e07ca0

||||||||||* _UIButtonBarButton: 0x143e07e60

|||||||||||*;слой = >>

|||||||||||* _UIModernBarButton: 0x143e08030- AMBIGUOUS LAYOUT для _UIModernBarButton: 0x143e08030.minY {id: 464}

||||||||||||* UIImageView: 0x143e09390 - AMBIGUOUS LAYOUT для UIImageView: 0x143e09390.minX {id: 717}, UIImageView: 0x143e09390.minY {id: 462}, UIImageView: 0x143e09390.Width {id: 716 0e: 716 0e: 93: U093: UII3x0: UII: 93): UII3: e0: 093: UI, UI, UX, UX, UI, ID: 7160: UI: 093: UI, UX, UX, UX, UX, UX: UX: 566: U3: 026, Ux, U0, U0, U0, U0, U0, U0, UX, UI, UI, IDS: 716: U0: 566: UI: 716: U0: 563: UX, 566: UX. U0: 566: UX. U0: 566: U3... U0. Image: 1316: eX...: UImage. UImage.}

||||||||||* UIView: 0x143e09550

||||||||||* _UIButtonBarButton: 0x143e09710

|||||||||||* _UIModernBarButton: 0x143e098e0

||||||||||||UIImageView: 0x143e12380

||||||||||* UIView: 0x143e09ea0

||||||||||* _UIButtonBarButton: 0x143e0a000

|||||||||||* _UIModernBarButton: 0x143e0a470

||||||||||||UIImageView: 0x143e12540

||||||||||* UIView: 0x143e0aa30

||||||||||* _UIButtonBarButton: 0x143e0ab90

|||||||||||*;слой = >>

|||||||||||* _UIModernBarButton: 0x143e0ad60 - AMBIGUOUS LAYOUT для _UIModernBarButton: 0x143e0ad60.minY {id: 535}

||||||||||||* UIImageView: 0x143e0bda0- AMBIGUOUS LAYOUT для UIImageView: 0x143e0bda0.minX {id: 737}, UIImageView: 0x143e0bda0.minY {id: 533}, UIImageView: 0x143e0bda0.Wight} 50: 03: 03: e0: e0: e0: 036: e0: e0: 03: e0: e0: 03: e0: e0: 03: e0: e0: 03: e0: e0: 03: e0: e0: 03: e0: 03: e0: 03: e0: e3}

|

Легенда:

* - is laid out with auto layout

+ - is laid out manually, but is represented in the layout engine because translatesAutoresizingMaskIntoConstraints = YES

• - layout engine host
...