Tag: uitableview

UISearchController的searchBar不会填满整个宽度

编辑:我正在使用Autolayout。 我有一个问题,用UISearchController的searchBar填充我的屏幕的整个宽度。 我的设置是这样的: 我有一个UIViewController。 在里面,我把所有的元素分开。 有一个UITableView显示结果。 由于我在search条重叠状态栏时遇到了问题,我创build了一个普通的UIView,它有一个约束条件,使它位于状态栏的下方,并填充UIViewController的全部宽度。 这是我在这里看到无数次的方法。 最后,我创buildUISearchController并将其添加为“wrapperView”的子视图 结果如下: 蓝色只能看到容器视图的扩展位置 对我来说,searchBar要么不能正确地填充容器,要么没有正确居中,因为左边的边看起来不像另一边那么宽。 而且,当search框处于活动状态时,所有内容都会正常显示,如下所示: 表格也显示正常 这里是我做我的设置的代码: //Mark: – Outlets @IBOutlet weak var wrapperView: UIView! @IBOutlet weak var tableView: UITableView! //Mark: – Properties let searchController = UISearchController(searchResultsController: nil) override func viewDidLoad() { /*! Sets the values of the searchController and it's behaviour */ searchController.searchResultsUpdater = self searchController.dimsBackgroundDuringPresentation […]

Xamarin在iOS中使用自定义UITableViewCell时抛出NullReferenceException

我有一个非常类似的问题,在Xamarin自定义UITableViewCell抛出系统NullReferenceException讨论的问题。 尽pipe如此,在回答问题之后,我的问题还没有解决。 我有一个自定义的UITableView BoardListCell 。 在我的故事板,我有一个UITableView 。 它可以在我的ViewController通过socketstableView 。 在我的视图控制器,我得到的数据。 然后我做tableView.Source = new BoardsTableViewSource(sourceData); 我的BoardsTableViewSource : using System; using System.Collections.Generic; using Foundation; using UIKit; public class BoardsTableViewSource : UITableViewSource { private List<List<Object>> data; Boolean normalBoards; public BoardsTableViewSource (List<List<Object>> data, bool normalBoards) { this.data = data; this.normalBoards = normalBoards; } public List<List<Object>> getData() { return data; […]

types'ViewController'不符合协议'UITableViewDataSource'

import UIKit class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } var alphNames = ["ABC","DEF","GHI","JKL","MNO","PQR","STU"] func tableView(tableView: UITableView, numberofRowInsection section: Int) -> Int { […]

拉下更多的细胞

我在互联网search了一个代码片段或者配方,它检测用户是否滚动到UItableview点触摸的UItableview上的最后一个单元格。 我不使用TableSource.Cs来加载我的对象。

导航栏和表格视图中的错误订单

从一个家庭VC,embedded在一个故事板:我点击左边的button,执行一个segue。 这个segue会把我带到一个带有自己tableview的导航控制器(这个对象附带的那个)。 我只是想要一个黑色的导航栏,但似乎导航栏是在视图和视图之前,我在tableView之前。 在故事板我设置:导航栏到“不透明的黑色导航栏”在表视图的属性检查器我把视图的背景设置为红色(是testing) 检查最后的图像进行更新 我的故事板: 故事板中的问题: 但是我所得到的是一种像这样的隐喻。 UPADATE(新问题导航栏黑色,状态栏透明,不能从故事板中隐藏):

UIRefreshControl如何检测用户是否开始拖动?

我在UITableViewController有一个UIRefreshControl 。 有没有什么办法可以检测用户是否开始向下拖动视图来刷新内容? 我不是说beginRefreshing方法。 我希望能够检测用户何时开始拖动 – 就像在调用beginRefreshing方法之前圆圈填满一样。 这可能吗?

如何创build像什么应用程序做的联系人列表

我正在创build一个创build用户configuration文件的应用程序。 我需要能够看到我的联系人谁安装了应用程序,以便我可以授予他们访问我的个人资料,并查看他们的个人资料。 如何获得完整的联系人列表,确定我的电话号码以创build我的帐户,并检查联系人中有多less人安装了应用程序? (类似于WhatsApp的做法) 我知道有可能通过使用Apple API获取联系人列表,但是我必须将所有信息发送到服务器以检查他们是否安装了应用程序? 谢谢。

parsing,如何计数,将数据放入数组中,然后显示数组的内容

我需要检查并显示固定tableView中Parse类中的对象数量,每个对象都有一个“guide”关键字,而tableView的每一行都以这些关键字命名。 问题:无法将数据添加到数组 我的想法是search他们,把结果放在一个数组: var totalOfTotalArray : [Int] = [] 然后,为了逐一显示数字,每一行将有: switch indexPath.row { cell.guideNumberOfMexLabel.text = String(self.totalOfTotalArray[indexPath.row]) } 这是查询 for pfKeyword in KeyWords.guideKeywordArray { var findHowManyMexQuery = PFQuery(className: KeyWords.ParseClassForPublicMessages) findHowManyMexQuery.whereKey("guide", containsString: pfKeyword) //MARK: – filter for Parse – should filter parse query findHowManyMexQuery.whereKey("messagePosition", nearGeoPoint: PFGeoPoint(location: myPosition), withinKilometers: kRadiusMessages) //MARK: geolocalized filter findHowManyMexQuery.countObjectsInBackgroundWithBlock { (count: Int32, error: […]

按照NSDatesorting表格部分

如何sortingNSDate ,使得如果date的时间是星期天早上的05:00,那么它将在星期六“晚上”停留,但最后在列表中? 我按date从JSON数据sorting我的tableview部分 [[API sharedInstance] commandWithParams:[NSMutableDictionary dictionaryWithObjectsAndKeys:@"fodboldStream", @"command", nil] onCompletion:^(NSDictionary *json) { //got stream //NSLog(@"%@",json); [[API sharedInstance] setSoccer: [json objectForKey:@"result" ]]; games = [json objectForKey:@"result"]; sections = [NSMutableDictionary dictionary]; for (NSDictionary *game in games) { NSNumber *gameType = game[@"dato"]; NSMutableArray *gamesForType = sections[gameType]; if (!gamesForType) { gamesForType = [NSMutableArray array]; sections[gameType] = gamesForType; } [gamesForType […]

UITableViewAutomaticDimension单元格滚动或拉动刷新后resize

我添加了一个表格视图,我在单元格中显示图像。 我也添加了这个代码: tableView.estimatedRowHeight = 175 tableView.rowHeight = UITableViewAutomaticDimension 这样细胞的大小取决于图像。 当我启动我的应用程序,但我得到这个: 和图像不加载,直到我开始滚动…如果我向下滚动一半的页面,然后回到顶部,我得到这个(这是正确的): 此外,如果我删除像button,只有在一个单元格中的图像,当我启动我的应用程序,如果我等待3秒,而不触及任何细胞resize,他们自己..?! 有任何想法吗? 我已经研究了谷歌和尝试旧版本的Xcode的奇怪的解决scheme,但似乎没有工作! 这里是我的TableViewController的代码的其余部分: extension TimelineViewController: UITableViewDataSource { func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { return 46 } func numberOfSectionsInTableView(tableView: UITableView) -> Int { return timelineComponent.content.count } func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { let headerCell = tableView.dequeueReusableCellWithIdentifier("PostHeader") as! PostHeaderTableViewCell […]