Re: [問題] Navigation設置titleView為searchBar問題
※ 引述《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
參考一下作法,有可能不符合你的需求,但就參考一下
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.194.129.244
※ 文章網址: https://www.ptt.cc/bbs/MacDev/M.1529147971.A.8A2.html
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章