10
Tôi có một mục nút thanh trong thanh điều hướng khi được nhấn, sẽ trình bày một UIAlertController
với kiểu là .ActionSheet
. Trong iPhone nó chỉ xuất hiện theo cách mà tôi muốn. Đối với iPad Tôi biết tôi cần phải thêmActionSheet Source View BarButtonItem
// For iPad, set the pop over bounds
var popOver = optionMenu.popoverPresentationController
popOver?.sourceView = button as UIView
popOver?.sourceRect = (button as UIView).bounds
popOver?.permittedArrowDirections = UIPopoverArrowDirection.Any
Có ai biết một cách sử dụng nút mục thanh như sourceView
và sourceRect
? Tôi muốn cửa sổ bật lên trỏ đến mục nút thanh.
HOÀN THÀNH! Cảm ơn tôi không thấy làm thế nào tôi bỏ lỡ điều đó. –