Iconize icon indicating copy to clipboard operation
Iconize copied to clipboard

icons problem when set by code

Open mabdollahiasl opened this issue 5 years ago • 4 comments

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.

mabdollahiasl avatar Mar 12 '19 14:03 mabdollahiasl

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

meiotoha avatar Apr 02 '19 09:04 meiotoha

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.

meiotoha avatar Apr 02 '19 10:04 meiotoha

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?

floa93 avatar Apr 12 '19 11:04 floa93

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.

happyclan avatar Apr 18 '19 21:04 happyclan