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 ...
随机推荐
- angular4 自定义表单组件
自定义表单组件分为单值组件和多值组件. 单值组件:input/select/radio/textarea 多值组件:checkbox/tree组件 条件: 1.必须实现ControlValueAcce ...
- 微信小程序之threejs全景
最近在开发小程序,身心疲惫,原因是功能和app相同,我裂开了. 各种封装组件,各种写页面,不过有个好处是以前写的h5拿来改一下标签,基本上还是ok的,就剩下最后几个功能,其中就有一个VR全景功能. 移 ...
- jnhs-java实体类的有参构造器 无参构造器Could not instantiate bean class 实体类No default constructor found
new一个对象的时候要用到构造函数, 例如Hello hello = new Hello();这时调用的是Hello的无参数构造方法; Hello hello = new Hello("hi ...
- appium+python 启动一个app步骤
询问度娘搭好appium和python环境,开启移动app自动化的探索(基于Android),首先来记录下如何启动待测的app吧! 如何启动APP?1.获取包名:2.获取launcherActivit ...
- innerhtml outhtml innerText outText 区别
innerHTML获取标签内的HTML outerHTML获取标签及标签内的HTML innerText 设置或获取位于对象起始和结束标签内的文本 outerText 设置(包括标签)或获取(不包括标 ...
- 洛谷P1890 gcd区间 [2017年6月计划 数论09]
P1890 gcd区间 题目描述 给定一行n个正整数a[1]..a[n]. m次询问,每次询问给定一个区间[L,R],输出a[L]..a[R]的最大公因数. 输入输出格式 输入格式: 第一行两个整数n ...
- win10 请求操作需要提升解决方案
记录一下: win10 系统管理员 打开后缀为 .xxx 的文件时, 系统提示: 请求操作需要提升 网上搜索了一下,原因是权限不够,故系统提示. 给当前用户加入了 管理员权限,各种权限都无效. ...
- django 结合 bootstrap 使用
git clone https://github.com/dyve/django-bootstrap3.git 要运行demo,需要在demo 中为其增加一个符号链接 bootstrap3 到上层目录 ...
- arcgis几何对象
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- WPF 触发器例子
WPF的触发器很强大,这里简单附上触发器的一个小例子,分别用XMAL和CS代码来实现一个功能,鼠标悬停在button上时改变字体颜色 1.XMAL代码如下: <Window x:Class=&q ...