久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何在 UIScrollView 中使用 UITableView 并接收單元格

How to use UITableView inside UIScrollView and receive a cell click?(如何在 UIScrollView 中使用 UITableView 并接收單元格點擊?)
本文介紹了如何在 UIScrollView 中使用 UITableView 并接收單元格點擊?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有 DiscountListTableViewController 在我的應用程序中顯示為單獨的屏幕.但是還有另一個屏幕 (PlaceDetailsViewController) 我需要在底部顯示相關折扣.

I have DiscountListTableViewController that is shown as a separate screen in my app. But there's another screen (PlaceDetailsViewController) where I need to show related discounts at the bottom.

目前,PlaceDetailsViewController.viewUIScrollView 作為容器,我將 DiscountListTableViewController.tableView 添加到此 UIScrollView.PlaceDetailsViewControllerviewDidLoad 中的 content 容器.這有效,表格視圖顯示正確,但無法接收單元格點擊.

Currently, PlaceDetailsViewController.view has UIScrollView as a container and I'm adding DiscountListTableViewController.tableView to the this UIScrollView.content container in viewDidLoad of PlaceDetailsViewController. This works and the table view is shown correctly, however unable to receive cell clicks.

我知道 UITableView 繼承自 UIScrollView 并且不知何故不建議(但不受限制).但是,從松耦合的角度來看,每個組件都應該以可以在其他地方獨立使用的方式設計,在我的例子中是 DiscountListTableViewController.

I know UITableView inherits from UIScrollView and it's somehow not advised (but not restricted). However, from loose coupling point of view, every component should be designed in a way it could be independently used elsewhere, and it's DiscountListTableViewController in my case.

PlaceDetailsViewController 組件只需要 DiscountListTableViewController 原樣,所以沒有邏輯原因不能直接使用.有什么建議?

PlaceDetailsViewController component just needs DiscountListTableViewController as-is, so there's no logic reason why it can't be used directly. Any suggestions?

推薦答案

答案:不要這樣做.

UITableview 繼承自 ----> UIScrollView : UIView : UIResponder : NSObject

UITableview is inherited from ----> UIScrollView : UIView : UIResponder : NSObject

蘋果說:

重要提示:您不應將 UIWebView 或 UITableView 對象嵌入UIScrollView 對象.如果這樣做,可能會導致意外行為因為兩個對象的觸摸事件可能會混淆和錯誤處理.

Important: You should not embed UIWebView or UITableView objects in UIScrollView objects. If you do so, unexpected behavior can result because touch events for the two objects can be mixed up and wrongly handled.

這篇關于如何在 UIScrollView 中使用 UITableView 并接收單元格點擊?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to subclass UIScrollView and make the delegate property private(如何繼承 UIScrollView 并使委托屬性私有)
Swift - how to get last taken 3 photos from photo library?(Swift - 如何從照片庫中獲取最后拍攝的 3 張照片?)
Setting contentOffset programmatically triggers scrollViewDidScroll(以編程方式設置 contentOffset 觸發 scrollViewDidScroll)
Photos app-like gap between pages in UIScrollView with pagingEnabled(使用 pagingEnabled 的 UIScrollView 中頁面之間的照片應用程序式間隙)
why UIScrollView is leaving space from top in ios 6 and ios 7(為什么 UIScrollView 在 ios 6 和 ios 7 中從頂部留下空間)
UIScrollView pauses NSTimer while scrolling(UIScrollView 在滾動時暫停 NSTimer)
主站蜘蛛池模板: 免费黄色小视频 | 国产伦精品一区二区免费 | 黄色激情视频在线观看 | 精品免费视频 | 午夜亚洲精品 | 日本一级淫片 | av影片在线观看 | 午夜精品在线观看 | 高潮毛片无遮挡免费看 | 久久久在线视频 | 国产香蕉av | 国产高清视频在线 | 国产一级黄色录像 | 韩日在线视频 | 色婷婷精品国产一区二区三区 | 久久av网站 | 91精品国产99久久久久久红楼 | 88av视频 | 日韩a在线| 天天拍天天射 | 国产又黄又爽 | 成人福利网站 | 黄色国产在线观看 | 久久久夜色精品 | 夜夜嗨av一区二区三区网页 | www.欧美精品 | 免费视频黄 | 久久久久久久影院 | 在线观看网址你懂的 | 欧美成人精品一区二区三区在线看 | 蜜臀久久99精品久久久久久宅男 | 国产免费a| 男人天堂手机在线 | 成人精品国产 | 久久99视频| 欧美三级韩国三级日本三斤在线观看 | 日韩av免费在线观看 | 伊人超碰在线 | 国产精品欧美激情 | 免费精品 | 国产理论在线 |