久久久久久久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)
主站蜘蛛池模板: 北条麻妃一区二区三区在线视频 | 日韩精品一区二区三区老鸭窝 | 亚洲欧美国产视频 | 成人一级毛片 | 亚洲国产精品成人 | 天天想天天干 | xxxxx黄色片 欧美一区免费 | 91中文字幕在线 | 特黄视频| 成人动漫一区二区 | 五月激情综合 | 免费毛片在线 | 一区二区亚洲 | 亚洲精品久久久9婷婷中文字幕 | 韩国电影久久 | 亚洲欧美中文日韩在线 | 在线观看国产91 | 国产成人一区二区 | 日本一区二区三区免费观看 | 中文字幕国产视频 | 久久久www成人免费无遮挡大片 | 日韩精品免费在线 | 狠狠操电影 | 黄色片免费 | 日韩色综合| 超碰97干| 国产网站在线播放 | 欧美日韩亚洲视频 | 少妇av片 | 国产精品久久久久久久久污网站 | 日韩在线欧美 | 欧美自拍日韩 | 91av视频在线 | 九九久视频 | 久久国产一区二区三区 | 国产jizz女人多喷水99 | 精品国产91 | 国产精品视频一区二区三区四蜜臂 | 欧美精品一区二区三区四区五区 | 久久久激情 | www精品美女久久久tv |