How do I cover the “no results” text in UISearchDisplayController's searchResultTableView?
How
do I cover the “no results” text in UISearchDisplayController's searchResultTableView?
I don't want to show the "no results" text while my server is processing a search query.

I figured out the exact coordinates of the table cell that contains the label and attempted to cover it.
self.noResultsCoverView = [[[UIView alloc] initWithFrame:CGRectMake(
0.0,
44.0,
320.0,
43.0
)] autorelease];
self.noResultsCoverView.backgroundColor = [UIColor whiteColor];
[self.searchDisplayController.searchResultsTableView addSubview:self.noResultsCoverView];
To my chagrin, my cover was above the table view, but below the label. I need the cover to be above the label. searchResultsTableView::bringSubviewToFront didn't
work, which makes me believe that the label isn't a child of the searchResultsTableView at
all.
BTW, this Stack Overflow answer doesn't quite work for me.
It works on the very first search, but flashes a weird black cover on subsequent searches.
|
this should do the work properly. The code to return at least one cell:
and for "showing" the clean cell:
|
||
|
You need to realize that when you have a You can easily detect this in code, and then return the appropriate result from the delegate/data source method, depending on which tableView object is asking. For example: - (NSInteger)tableView:(UITableView *)tv numberOfRowsInSection:(NSInteger)section The point is that your data source and delegate methods are serving two tables, and you can (and should) check for which table is asking for data By the way, the "No results" is (I believe) provided by a background image which the |
|||
|
I haven't tried it myself, you can give it a try-- Link Regards, |
|||
|
Try this it worked for me In the UISearchDisplayController delegate do this:=
|
版权声明:本文为博主原创文章,未经博主允许不得转载。
How do I cover the “no results” text in UISearchDisplayController's searchResultTableView?的更多相关文章
- 自定义UISearchDisplayController的“No Results“标签和”Cancel“按钮
本文转载至 http://www.cnblogs.com/pengyingh/articles/2350154.html - (void)searchDisplayControllerWillBegi ...
- Flutter中的Container和Text组件的常用属性
效果图: import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends St ...
- UISearchDisplayController “No Results“ cancel修改
Recently I needed to fully customize a UISearchBar, so here are some basic "recipes" on ho ...
- 斯坦福CS课程列表
http://exploredegrees.stanford.edu/coursedescriptions/cs/ CS 101. Introduction to Computing Principl ...
- jQuery系列:Ajax
1. load(url, [data], [callback]) 1.1 解析 载入远程 HTML 文件代码并插入至 DOM 中. 语法格式: load(url, [data], [callback] ...
- CSS & JS 制作滚动幻灯片
==================纯CSS方式==================== <!DOCTYPE html> <html> <head> <met ...
- 微信小程序--火车票查询
微信小程序--火车票查询 写在最前面 微信小程序自九月份推出内测资格以来,经历了舆论热潮到现在看似冷清,但并不意味着大家不那么关注或者不关注了.我想不管是否有内测资格,只要是感兴趣的开发者已经进入潜心 ...
- JQuery常用方法一览
$(”p”).addClass(css中定义的样式类型); 给某个元素添加样式 $(”img”).attr({src:”test.jpg”,alt:”test Image”}); 给某个元素添加属性/ ...
- HTTP POST 提交问题
最近用http+post方式实现了系统间数据交互的需求. 常用的方式是 application/json方式直接post json对象 . 告诉服务器数据格式将会是 { Name : 'John Sm ...
随机推荐
- quartz 通用的多线程定时任务
TaskManager package mytest.task; import java.text.ParseException; import org.quartz.CronTrigger; imp ...
- 3_58 csapp 第三版的答案
参考代码了http://blog.csdn.net/scf0920/article/details/77543294 3.58 看汇编写c代码 long decode(long x, long y,l ...
- 洛谷P1774 最接近神的人_NOI导刊2010提高(02) [2017年6月计划 线段树03]
P1774 最接近神的人_NOI导刊2010提高(02) 题目描述 破解了符文之语,小FF开启了通往地下的道路.当他走到最底层时,发现正前方有一扇巨石门,门上雕刻着一幅古代人进行某种活动的图案.而石门 ...
- java简单jdbc查询操作
所采用的mysql的数据库驱动版本:5.0.8 mysql-connector-java-5.0.8-bin.jar 程序结构图: 表结构: 创表sql: Create Table CREATE TA ...
- 模拟20 题解(waiting)
留坑待填 T2 #include<cstdio> #include<vector> #include<cstring> #include<iostream&g ...
- Codeforces 455C
题目链接 C. Civilization time limit per test 1 second memory limit per test 256 megabytes input standard ...
- Hdu 1150
Machine Schedule Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- 访问Bing地图
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- Codeforces Round #395 (Div. 2) A. Taymyr is calling you【数论/最小公倍数】
A. Taymyr is calling you time limit per test 1 second memory limit per test 256 megabytes input stan ...
- 跟我一起学extjs5(02--建立project项目)
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/jfok/article/details/35569057 跟我一起学extjs5(02--建立pro ...