問題タブ [searchdisplaycontroller]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ios - 検索表示コントローラーの問題
iOSで検索バーと検索ディスプレイコントローラーを使用することを学んでいます。テーブルビューから行を選択すると、新しいビューに行の名前のラベルが表示されます。いくつかの問題が発生しています。まず、検索バーにテキストを追加し始めて検索表示が表示されると、検索バーが表示されなくなります。フィルタリングされた結果が表示されますが、行を選択しても次のビューに移動しません。これは、テーブルがフィルタリングされている場合にのみ発生します。コードは次のとおりです。
ViewController.h
ViewController.m
助けてくれてありがとう!
uitableview - searchDisplayController、UITableView、Core Data、Swift
で表を検索しようとしていますsearchDisplayController
。データフィルタリングが構成され、検索ダイアログが機能します。prepareForSegue
ここで、現在の値indexPath
を newに送信するメソッドを使用したいと思いますUIViewController
。
}
関数prepareForSegue
条件で self.tableView ==self.searchDisplayController.searchResultsTableView
が満たされていません。
indexPath = self.tableView.indexPathForSelectedRow()
代わりに常に代入しますindexPath = self.searchDisplayController.searchResultsTableView.indexPathForSelectedRow()
。これにより、検索結果で行を選択するとエラーが発生します。
Dropbox のプロジェクトへのリンク: https://www.dropbox.com/s/bqv46nkoa4s3ibg/lesson-12-2-swift%203.zip
ios - uiviewcontroller で uisearchbar の場所を設定する
ビューコントローラーに検索バーを追加しようとしています。tableviewcontrollers を使ったチュートリアルはたくさんありますが、viewcontrollers はありません。私の問題は(ここにある他の複数の質問と同様に)検索バーを選択すると、ナビゲーションバーが上に移動し、検索テーブルビューが重なりますが、検索バーは上に移動しません。
プログラムで追加しようとすると、次のようにテーブル ヘッダーに実装できます。
私の UI では、検索バーとテーブルビューの間にボタンがあります。searchBar を navigationBar のすぐ下に設定したいと思います。どうすればいいですか?
ios - ナビゲーション バー付きの uiviewcontroller で、ナビゲーション バーに searchBar が表示されない
NavigationBar を備えた UIViewController があります。次のコードでsearchBarを配置しようとしています:
コードは以前の UIViewController で動作しました。違いは、これがモーダル セグエである NavigationController に埋め込まれているため、NavigationBar を手動で配置する必要があることです。
これをNavigationBarに表示するには何が欠けていますか?
ios8 - iOS 8 の searchDisplayController の代替手段は何ですか?
今朝、アプリの展開ターゲットを 8.0 に変更しました。残念ながら、searchDisplayController は iOS 8.0 で廃止されました。
私の質問は、アプリを iOS 7.x と 8.x の両方で引き続き動作させたい場合、searchDisplayController の代わりになるものは何ですか?
ios - Emulate searchbar in Calendar app
I am trying to emulate the search bar in the Calendar app and finding it surprisingly difficult although many people have posed this question on SO and elsewhere and many half answers have been offered. (I need to support IOS 7).
The main requirements are
1) There is a search bar button.
2) When above button is pressed, a search bar with cancel appears in the navigation bar.
To accomplish 1) you just put a bar button item on the navigation bar. No problem.
To accomplish 2) is the hard part.
To get the search bar to display in the navigation bar as opposed to elsewhere you are supposed to just set
self.searchDisplayController.displaysSearchBarInNavigationBar= true
as here;
I can get the search bar to appear in the nav bar but without a cancel button.
The code to show a cancel button is supposed to be:
This is not working in conjunction with placing the search bar in the nav bar.
Finally, as opposed to searchDisplayController, something called a search bar has a property called .hidden. After dragging a search bar and search displaycontroller to the view, I've created an outlet property for this and tried to change this without success. (Changing it from true to false has no apparent effect on the output.)
Is there anyone out there who has successfully created this UX who can describe all the steps needed to emulate the search bar in the calendar app in IOS 7.0?
ios - ios/objective-c: カスタム セルと組み合わせた検索ディスプレイ コントローラー
NSPrediate を利用してコア データから作成されたテーブルビューを検索する検索バーと検索ディスプレイ コントローラーを使用しています。次のコードは、ほとんどの VC で正常に機能します。ただし、カスタム セルを使用している場合は、検索するたびに結果がゼロになります。
検索用にデータソースを調整する cellforrowatindexpath のコードは次のとおりです。
これは VC がカスタム セルを使用する唯一のケースであるため、結果が返されないのはそのためではないかと考えています。
cellforrowatindexpath
これは、カスタム セルを使用するよう指示する行です。
最後に、セル内の値が設定される方法は次のとおりです。
検索結果にアイテムが表示されないのは、カスタム セルのせいでしょうか?
注: 検索時に返されるアイテムの数は常にゼロです。