Что я пробовал до сих пор:
- Я смотрел сеанс WWDC: .
В видео они установили sourceItem с использованием элемента кнопки панели, который правильно не отображает стрелку. Я попробовал использовать тот же подход с обычным UIButton, но стрелка по-прежнему отображается. - Отключение стрелки с помощью:
или:Код: Выделить всё
alertController.popoverPresentationController?.permittedArrowDirections = []
скрывает стрелку, но нарушает анимацию листа действий — лист появляется мгновенно, а не плавно скользит вверх.Код: Выделить всё
alertController.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection(rawValue: 0) - Вот код, который я использую:
Код: Выделить всё
@IBAction func buttonTapped(_ sender: UIButton) { let action = UIAlertAction(title: "Action", style: .destructive) let alertController = UIAlertController(title: nil, message: "Message", preferredStyle: .actionSheet) alertController.addAction(action) alertController.popoverPresentationController?.sourceItem = sender alertController.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection(rawValue: 0) present(alertController, animated: true) } - Ожидаемый результат: https://drive.google.com/file/d/1ItU2lt ... sp=sharing
- Фактический результат:
https://drive.google.com/file/d/1ItT8Ab ... sp=sharing
Подробнее здесь: https://stackoverflow.com/questions/798 ... -in-ios-16