Closed augustosamame closed 8 years ago
Hi @augustosamame,
Table screens also have header and footer views. This sounds like a case where a header view would be appropriate. You can specify the view you want as your header view by defining a table_header_view
and returning an instance of a UIView
:
class HomeScreen < PM::TableScreen
# ...
def table_header_view
create!(TopHomeView, :top_home_view)
end
Note that the "bang method" (create!
) will return an instance of UIView
.
Let us know if you have any problems with this approach.
Yep. This worked. Thanks for your help!
This issue is solved but generated a slight complication. I am including a button in the table_header which will open another ProMotion Screen:
class MyTableHeader < UIView
def on_load
append(UIButton, :new_match_button).on(:tap) do |sender|
open NewMatchScreen.new(nav_bar: true)
end
end
end
However, I am getting an error when trying to open the screen. I assume this is because the UIView class does not include the ProMotion open method. What is the correct way to include PM methods in the plain UIView class?
Never mind. Just found it. This code works:
class MyTableHeader < UIView
def on_load
append(UIButton, :new_match_button).on(:tap) do |sender|
find.screen.open NewMatchScreen.new(nav_bar: true)
end
end
end
Hi. I am unable to find a way to change a TableScreen layout, specifically the TableView cell's vertical starting position.
I have an UIView on the top of my screen to show some buttons, and the TableView cells should start underneath, but right now they are on top of each other.
I have even managed to move the TableView using the REPL console:
rmq(4496872960).nudge d: 10
where 4496872960 is the id of my
UITableViewWrapperView
object, but I have no idea where to put the layout coordinates for this object in code.My screen code:
EDIT:
I have kept trying to solve this and I have now added a style to my UITableViewWrapperView object like this:
In my stylesheet I am able to therefore style everything: background_color, hidden status, but the frame style is just ignored.