MonoTouch Dialog Box

I have a problem with overriding the GetHeight method when developing an iPad application using MonoTouch.Dialog. I implement IElementSizing , but my GetHeight method GetHeight never called.

Has anyone else encountered this problem? Thanks.

I made sure my root.UnevenRows = true;

I also tried to include a dialog project and set a breakpoint in GetHeight () for any of the elements that implement IElementSize without any luck. In the previous iPhone project, this worked fine, but on the iPad I was still stuck. Are there any other โ€œabysses" that I could lose?

+6
source share
1 answer

This is a kind of bug in MonoTouch.Dialog. Basically, when you assign a Root Element, it wants to know if there are odd rows so that it can create and cache the corresponding UITableViewSource object.

However, if you add sections with elements that implement IElementSizing into the Root element after the Source object has already been created. Then it will not cause GetHeight to be canceled. An example of this is getting the async and callback data and adding the resulting sections / elements to the RootElement ... or essentially anytime you add sections / elements after calling PrepareRoot ().

There is a simple way to do this:

 this.Root.UnevenRows = true; 

However, without looking at your code, I cannot say if this is the error you see.

+10
source

Source: https://habr.com/ru/post/901316/


All Articles