https://bugzilla.novell.com/show_bug.cgi?id=645249

https://bugzilla.novell.com/show_bug.cgi?id=645249#c1


Jonathan Pryor <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from Jonathan Pryor <[email protected]> 2010-11-02 03:38:55 UTC 
---
Yet another case of "how does this work in Java?!"

(i.e. we need to write the equivalent Java code and see if (1) it works, and
(2) if it works, why it works.)

Android source is helpful here; specifically (on my machine),
ListView.java:1761:


    AbsListView.LayoutParams p = 
        (AbsListView.LayoutParams) child.getLayoutParams();

which implies that we should instead do:

    itemRow.LayoutParameters = new AbsLinearLayout.LayoutParams(...);

Of course, if we do that, we instead get:

E/AndroidRuntime(  831): java.lang.ClassCastException:
android.view.ViewGroup$LayoutParams
E/AndroidRuntime(  831):     at
android.widget.LinearLayout.measureHorizontal(LinearLayout.java:654)
E/AndroidRuntime(  831):     at
android.widget.LinearLayout.onMeasure(LinearLayout.java:306)

and LinearLayout.java:654:


    final LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams)
           child.getLayoutParams();

To which I say...huh?  These appear to be contradictory.  So either the C# is
wrong (and then we need to know _how_ and _why_ it's wrong), or this pattern
simply isn't permitted on Android (and the Java equivalent will fail for the
same reasons).

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to