-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't get table_header_view to work #711
Comments
Update: now I'm working on setting the header view manually in the def on_load
tableView.tableHeaderView = create(MyTableHeader, :table_header)
end
class MyTableHeader < UIView
end Unfortunately, this still doesn't work...I'm running into this error:
Note that this is a RedPotion app which includes RMQ. Maybe I'm missing something? /cc @twerth @squidpunch |
That is a rmq command, which means it always returns an rmq object (which is basically an array). This is how you can do chaining. To get the internal object(s), you use We do this kind of thing a lot, so there is shortcut: |
Oh, I see. I need to change
The UILabel never appears. |
Thanks to a comment in slack by Steve Kellock, I went back and tried the original ProMotion method, using what I've learned about RMQ. It seems the
However, this was only part of the problem that I was trying to solve. The real table view that I am trying to add this header to is a "searchable" table view. It seems that this |
Hey, sorry about the late / non replies, @andrewhavens . Still trying to get caught up from my trip. I'm spinning up an app to test it right now. |
You're right. The UISearchBar is set to the tableHeaderView of the UITableView. Any ideas? I can think of a few solutions, but they seem hacky. Could you show what the end result is supposed to look like? |
Here's an example of what I'm ultimately trying to achieve: Notice that the UISegmentedControl (as well as a tappable icon) is above the search bar. Before starting on this, my original thought was that the search bar was somehow part of the view that rendered the table cells, so I thought if I specified a custom table header view, it would appear above the search bar. After some research, I've found that the search bar provides a configuration option that generates a UISegmentedControl, which they refer to as scope buttons. I found a way to specify them: def on_load
self.searchDisplayController.searchBar.showsScopeBar = true
self.searchDisplayController.searchBar.scopeButtonTitles = ['Tab1', 'Tab2']
end It seems to be a little buggy with the PM implementation of the search bar (clicking on the search bar hides the scope buttons and they won't come back). It would be nice to be able to configure these settings as part of the Unfortunately, it seems that the scope buttons are intended to be displayed below the search bar, so this might not even work for what I'm trying to do. Maybe I need a custom title bar? One tricky thing is that the design intends to make the header view background semi-transparent so that a background image will show through. Not sure if this is even something that could be configured/styled or if reimplementing a custom search is inevitable. |
Ooh, that's really cool! Yes, we should add that to searchable. Something like: class MyScreen < PM::TableScreen
title "My Screen"
searchable placeholder: "Search", scope_bar: [ "Tab1", "Tab2" ] You can make the background semi-transparent. @silasjmatson might have more thoughts on both the search bar/segment controls (he's working on one right now, although it's Objective-C) and also the blurry background, which he built into an app we built a while back. |
I've done some initial work on supporting scopes but sadly it never got past a barely cobbled together version that barely worked. Certainly not ready for primetime... and it was about a year ago. |
See #509 |
Closing this since the original topic that this issue was related to (table header view) has been solved. |
I'm looking forward to using this feature. =] I'm trying everything I can think of, but I can't seem to figure out how to use the
table_header_view
feature on a table screen.What am I doing wrong?
The text was updated successfully, but these errors were encountered: