infinitered / infinitered/rmq

Apply styles to UIButton Inner Objects

Open
#331 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
305
Forks
51
PR merge metrics
No merged PRs in 30d

Description

I am having trouble applying styles on initial load to the inner objects of an UIButton

For example this works and properly styles the label for a button when clicked:

append(UIButton, :lives_counter).on(:tap) do |sender|
rmq(:lives_counter).children(UIButtonLabel).apply_style(:lives_counter_label)
end

but if I want to apply the style to the UIButtonLabel from the start, it does not work. The style is ignored:

append(UIButton, :lives_counter).on(:tap) do |sender|
end
rmq(:lives_counter).children(UIButtonLabel).apply_style(:lives_counter_label)

This is an UIView I am using for a Table Header. Complete code for view follows:
```

class HomeTableHeader < UIView
include PM::Styling

def on_load

append(UIButton, :stars_counter).on(:tap) do |sender|

end
append(UIButton, :lives_counter).on(:tap) do |sender|
rmq(:lives_counter).children(UIButtonLabel).apply_style(:lives_counter_label)
end
rmq(:lives_counter).children(UIButtonLabel).apply_style(:lives_counter_label)

append(UIButton, :faces_counter).on(:tap) do |sender|

end

end

def will_appear
rmq(:lives_counter).children(UIButtonLabel).apply_style(:lives_counter_label)
end

def on_appear
rmq(:lives_counter).children(UIButtonLabel).apply_style(:lives_counter_label)
end

end
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the HomeTableHeader on_load method and compare the initial UIButtonLabel styling call with the same call inside the tap handler. Reproduce the issue with the provided view code; done when the initial application produces the same label styling as applying it after tapping.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, ruby
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.