Iconize
Iconize copied to clipboard
icons problem when set by code
hi make an iconbutton and on click of it change the text with another icon it shows just '...' as icon. it happens just on ios.
I may find it.It could not be '...' but the word your set like 'fas-xxx-xxx'.
with latest packages on iOS 12.2.
I found UIButton.SetTitle()
was called twice. One is by IconButtonRenderer
and another is by ButtonLayoutManager
.
You can see there is no updatetext
method in ButtonRenderer,and i fount it in ButtonLayoutManager
.
public ButtonRenderer()
{
......
_buttonLayoutManager = new ButtonLayoutManager(this);
}
and in 'ButtonLayoutManager',
void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
......
else if (e.PropertyName == Button.TextProperty.PropertyName)
UpdateText();
......
}
You can override the UIButton.SetTitle
then write stacktrace to view the call stack.
I'm not sure if this is the true factor,and I'm finding a workaround ,my be I need rewrite the whole IconButtonRenderer
?
@mabdollahiasl @jsmarcus
I create a subclass of IconButton
and add a new property 'IconProperty' and use it ,then rewrite the render to use 'IconPropery' ,seem work well.
I am having the same problem, sometimes it just shows e.g. "fas-download" on iOS. @meiotoha could you create a pull request and let them merge your fix?
I am having this same issue. Is there a fix on the way?
I have a lame fix where I pop the button out of the layout and then push it back in. It forces a layout. It is also hackyAF.