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 ...
随机推荐
- mysql8 navicat
先把root账户的加密规则改回去 ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; 然后使用新 ...
- Django ORM中的查询,删除,更新操作
ORM查询操作 修改views.py文件 from django.shortcuts import render, HttpResponse from app01 import models from ...
- Docker搭建ELK的javaweb应用日志收集存储分析系统
1.启动elasticsearch docker run -d --name myes -p 9200:9200 elasticsearch:2.3 2.启动kibana docker run --n ...
- linux查看现在在运行的进程 $ pstree -a$ ps aux
这都是查看现有进程的. ps aux 的结果比较杂乱 pstree -a 的结果比较简单明了,可以看到正在运行的进程及相关用户.
- 快速乘O(1)和O(log)
O(1)快速乘来自骆可强:<论程序底层优化的一些方法与技巧> //O(1)快速乘 inline LL quick_mul(LL x,LL y,LL MOD){ x=x%MOD,y=y%MO ...
- 【洛谷P2722 USACO】 总分 01背包模板
P2722 总分 Score Inflation 题目背景 学生在我们USACO的竞赛中的得分越多我们越高兴. 我们试着设计我们的竞赛以便人们能尽可能的多得分,这需要你的帮助 题目描述 我们可以从几个 ...
- MySQL Daemon failed to start错误解决办法是什么呢?
首先我尝试用命令:service mysql start 来启动服务,但是提示: MySQL Daemon failed to start 一开始出现这个问题我很方,然后开始查,说什么的都有,然后看到 ...
- 一个宽度不确定的DIV里放三个水平对齐的DIV,左右两个DIV宽度固定为100px,中间那个DIV自适应宽度
方法一:浮动 注意三个div的位置 <html><head> <meta charset="utf-8"> <style type=&q ...
- PHP 学习1.0
1.简单一个class 类: 获取表单提交的值 采用post方式 <html><head><title>PHP TEST</title></hea ...
- vs2015卸载、vs2008安装Visual Assist x
卸载2015 参考博文 1. 手动卸载VS2015的主要部分: win10系统: 控制面板---程序和功能--Microsoft Visual Studio 2015---更改卸载 2. 下载工具并解 ...