Я искал всюду в документах и примерах ProMotion, но мне не удается найти способ изменения компоновки TableScreen, в частности, вертикальную начальную позицию ячейки TableView.Изменение шаблона планшета ProMotion
У меня есть UIView в верхней части экрана, чтобы показать некоторые кнопки, и ячейки TableView должны начинаться снизу, но сейчас они находятся друг на друге.
Я даже удалось переместить TableView с помощью REPL консоли:
rmq(4496872960).nudge d: 10
где 4496872960
это идентификатор моего UITableViewWrapperView
объекта, но я понятия не имею, где поставить макет координаты этого объекта в коде ,
Мой код экрана:
class HomeScreen < PM::TableScreen
title I18n.t("home_screen.title")
tab_bar_item title: I18n.t("home_screen.title"), item: "icon-home_32x32.png"
row_height :auto, estimated: 30
stylesheet HomeScreenStylesheet
def on_load
@matches = [{attributes: {status: "dummy1", player2: {email: "[email protected]"}}},{attributes: {status: "dummy2", player2: {email: "[email protected]atch.com"}}}]
append(TopHomeView, :top_home_view)
set_nav_bar_button :left, title: I18n.t("home_screen.sign_out_label"), image: image.resource("icon-logout-32x32.png"), action: :sign_out
set_nav_bar_button :right, title: (Auth.current_user ? Auth.current_user["email"] : ""), image: image.resource("icon_user_50x50.png"), action: :open_profile
load_async
end
def table_data
[{
cells: @matches.map do |match|
{
title: match[:attributes][:player2][:email],
subtitle: match[:attributes][:status],
action: :play_round,
arguments: { match: match }
}
end
}]
end
EDIT:
Я все пытался решить эту проблему, и я теперь добавил стиль моей UITableViewWrapperView
объекта, как это:
def viewDidLoad
super
rmq(UITableViewWrapperView).apply_style(:style_for_table_wrapper)
end
В моя таблица стилей. Я могу поэтому все: background_color, скрытый статус, но стиль рамки просто игнорируется.
def top_home_view(st)
st.frame = {l:20, t: 20, w: 300, h: 60}
st.background_color = color.white
end