MonoTouch Dialog StringElements Variable Cell Height
Asked Answered
L

1

6

I am having a problem overriding the GetHeight method when developing an iPad application with MonoTouch.Dialog. I am implementing IElementSizing but my GetHeight method never gets called.

Has anyone else ran into this problem? Thanks.

I made sure that my root.UnevenRows = true;

I also tried including the dialog project and placing a breakpoint in the GetHeight() for any of the Elements that implement IElementSizing with no luck. In a previous iPhone project this worked fine but on the iPad I am still stuck. Are there any other 'gotchas' that I could be missing?

Leucomaine answered 11/11, 2011 at 19:49 Comment(0)
U
10

This is sort of a bug in MonoTouch.Dialog. Basically, when you assign the Root Element it wants to know whether there are uneven rows so it can create and cache the appropriate UITableViewSource object.

However, if you add Sections with Elements that implement IElementSizing to the Root element after the Source object has already been created. Then it will not call your GetHeight override. An example of this is if you fetch data async and callback and add the resulting Sections / Elements to to the RootElement...or essentially anytime you add Sections / Elements after PrepareRoot() is called.

There is a simple workaround for this:

this.Root.UnevenRows = true;

Without looking at your code however, I cannot say if this is the bug you are seeing.

Unroof answered 12/11, 2011 at 5:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.