From: Arno P. <ar...@pu...> - 2010-03-06 17:38:05
|
you are right that this is a little 'messy'. I couldn't think of another way of doing this. I'm not sure how your proposed solution would work. A problem could be polymorphism between the UIViewWithImage and UIView. Before you spend time on this, would you mind explaining how the inheritance hierarchy would look like? Arno On 3/6/10 4:54 AM, Panayotis Katsaloulis wrote: > I've seen that you have added a method named > setBackgroundImage(UIImage backgroundImage) > in core xmlvm library. > And in order to properly handle it, you have used inheritance of UIView instead of categories. > As far as I have seen, this is used under android to display an image underneath a widget. > > I believe this approach is bad and creates confusion. Although this will properly work for any widgets that actually inherit org_xmlvm_iphone_UIView, it breaks in all other cases. > All native iPhone widgets which inherit directly from UIView and not from org_xmlvm_iphone_UIView, do not have this method (and do not need it actually). > Still in the API it seems that everything supports it (although it doesn't). > So it's very easy to break the code, for example by inherit any other UI object (except UIView) and use the setBackgroundImage method! > > If this is really needed under Android and there is no other way to do it, I'd suggest to create a new UIView component (something like UIViewWithImage or UIViewAndroid) which will have this functionality and let View object in Android library inherit from this. > Thus it is clear which has which, and would not be possible to break the code any more. > > If you wish, I could make a patch like this and send it for approval. > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users |