Re: [問題] Navigation設置titleView為searchBar問題

作者: rollr (衛生紙的心情)   2018-06-16 19:19:27
※ 引述《hungwei0331 (Game)》之銘言:
: 前輩們好::
: 因專案想將searchBar放置於titleView,
: 但searchBar放完卻無法觸發searchBarDelegate,
: 目前有一個解法為使用以下func
: override func point(inside point: CGPoint, with event: UIEvent?) -> Bool,
: 加入上述程式碼可正常觸發searchBar,
: 但navigationBarItemButton卻又無法點擊 ..
: 想請問前輩們是否有推薦的解法能解決此問題,
: 附上demo source code,
: https://www.dropbox.com/s/z6z6ld6l2c8oaus/TitleViewTest.zip?dl=0
: 打擾了 謝謝
我之前的經驗是直接將 searchBar 放到 titleView,不需要再讓 UIView 去包起來
https://www.dropbox.com/s/qmaqs41nslbp0rg/TitleViewTest%202.zip?dl=0
參考一下作法,有可能不符合你的需求,但就參考一下

Links booklink

Contact Us: admin [ a t ] ucptt.com