久久久久久久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)
主站蜘蛛池模板: 欧美一级淫片免费视频黄 | 亚洲欧洲日本国产 | 男人天堂社区 | 91精品国产综合久久久密闭 | 搞av.com| 日韩一区在线播放 | 99精品国产一区二区青青牛奶 | 成人免费在线观看 | 久久国产精品-国产精品 | 久久国产精彩视频 | 亚洲一区二区三区视频 | 免费观看a级毛片在线播放 黄网站免费入口 | 亚洲精品久久久久久首妖 | 精品成人 | 成人免费观看男女羞羞视频 | 国产精品18hdxxxⅹ在线 | 在线看h | 欧美精品一区二区三区在线播放 | 特级做a爰片毛片免费看108 | 精品伊人 | 亚洲成人精 | 亚洲成人动漫在线观看 | 成人国产在线视频 | 嫩草懂你的影院入口 | 日日日日日日bbbbb视频 | 亚洲一一在线 | 久久久一区二区三区四区 | 99日韩 | 国产美女久久久 | 一级黄片一级毛片 | 国产999精品久久久 日本视频一区二区三区 | 日韩在线视频播放 | 超碰免费在线 | av中文在线 | 精品1区2区3区4区 | 91麻豆产精品久久久久久夏晴子 | 艹逼网 | 国产7777| 一区二区三区 在线 | 日日夜夜精品视频 | 国产精品一区二区久久 |