久久久久久久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 觸發(fā) 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)
主站蜘蛛池模板: 国产一区二区久久久 | 久久精品91久久久久久再现 | 日本黄色影片在线观看 | 欧美一区二区三区在线观看视频 | 2021狠狠干| 日日夜夜精品免费视频 | 午夜视频网站 | 一本一道久久a久久精品综合蜜臀 | av免费网站在线 | 日韩中文字幕视频在线观看 | 久久天天综合 | 国产欧美精品一区二区色综合朱莉 | 最新国产福利在线 | 秋霞av国产精品一区 | 国产精品免费一区二区三区四区 | 亚洲高清av在线 | 亚洲欧美在线视频 | 狠狠操天天操 | 久久成人精品视频 | 欧美一区在线看 | 国产成人精品综合 | 欧美成ee人免费视频 | 日韩色图在线观看 | 国产精品免费一区二区三区 | 少妇黄色| 成人在线视频观看 | 亚洲国产18 | 精品无码久久久久久国产 | 久久久久久久久久久福利观看 | 五月天天丁香婷婷在线中 | 中文在线a在线 | 亚洲www啪成人一区二区 | 91免费观看在线 | 国产三级一区二区三区 | 久久久久久久久久久久久久久久久久久久 | a在线视频 | 国产美女久久 | 久久久久久国产精品免费免费狐狸 | 91佛爷在线观看 | 超级碰在线 | 亚洲电影免费 |