Cross-platform SDK and HTML5 tools for mobile app development
X
 
9 posts / 0 new
Last post
mhoeben
mhoeben's picture
Offline
Joined: 3 Mar 2012
Posts:
NativeUI Label events

Hi,

Reading through the forum I get the impression that the NativeUI's Label class does not support any events, whatsoever, right? If any touch events (pointer press, move, etc...) are to be captured on a label one needs to route its own events from a Screen class?

Thanks!

mhoeben
mhoeben's picture
Offline
Joined: 3 Mar 2012
Posts:
Excellent! Thanks!

Excellent! Thanks!

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:
Hey Maarten, Going back to

Hey Maarten,

Going back to some older questions - those grouped listviews aren't in MoSync yet, but I've heard that they will be "soon".

You should be able to change the colours and fonts and everything on buttons - button->setBackgroundColor(), button->setFont(), button->setFontColor(), button->setFontSize() should all work.

The grey thing I think you may have to live with - iOS likes to show the user that something has changed when they press a button.

It is possible to mix NativeUI and MAUI, but not on the same screen.  I've done projects where some screens are nativeui (for performance) and some are MAUI (for flexibility).

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:
Hi, it sounds like that this

Hi, it sounds like that this is just how iOS applications work - NativeUI is always going to be how the native platform works.  This is a good thing - it keeps consistency between applications, but you don't necessarily get to decide how each widget behaves.  MoSync provides three different UI solutions though - NativeUI, Web UI and MAUI.  Will one of the other UI solutions fit your requirements better?

mhoeben
mhoeben's picture
Offline
Joined: 3 Mar 2012
Posts:
rival wrote: MoSync provides

rival wrote:
MoSync provides three different UI solutions though - NativeUI, Web UI and MAUI.  Will one of the other UI solutions fit your requirements better?

I'll work around it. Instead of using ImageButton I'll use Image and then do the initial event routing (for MAW_EVENT_POINTER_PRESSED) from the Moblet to the tabscreen myself. I like using the NativeUI just for the reason you touch on too; it keeps user experience consistent with the platform. However, sometimes you want stuff that's not available in the NativeUI to implement features that would be available in a true native application. In my opinion it would make sense (if technically possible) to route more events to classes that don't necessarily use them. I understand there's a balance between performance and flexibility here...

Anyway; I would be mimicing NativeUI in MAUI or WebUI if I would switch to either. One of the reasons I end up using Mosync is because I want the application to blend in with other applications (not be special) and I haven't seen convincing browser based implementations of the native UI's of iOS, Android and Windows Phone. Mixing NativeUI with MAUI is not possible (or is it?) - maybe I'll end up doing something with WebUI.

mhoeben
mhoeben's picture
Offline
Joined: 3 Mar 2012
Posts:
Ok, already found out;

Ok, already found out; ImageButton seems to do the trick just fine.

mhoeben
mhoeben's picture
Offline
Joined: 3 Mar 2012
Posts:
mhoeben wrote: Ok, already

mhoeben wrote:
Ok, already found out; ImageButton seems to do the trick just fine.

Except for the fact that it greys the button upon selection :-(

mhoeben
mhoeben's picture
Offline
Joined: 3 Mar 2012
Posts:
The thing is with the

The thing is with the NativeUI button class is that you cannot change the background or font color, remove the border or do anything to 'skin' it. I guess that if you want to do that, you'll say I need to use the MAUI environment. Then, however, I'll loose all the other good native stuff...

Correct me if I'm wrong, but at the moment the Native UI API won't let you develop something akin to the Notes or Reminders applet on the iPhone, where you have non-white/blue buttons.

On the subject of flexibilty; what would you suggest how you would mimic the iPhone settings screen where you have groups of buttons (Airplane Mode...Carrier - Sounds...Wallpaper) on a greyish background. I guess these are similar to the ListView but I have not figured out how to do this in Mosync.

Thanks!

Maarten

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:
Hi, that's right. What you

Hi, that's right. What you need it the NativeUI button class, which does have ButtonClicked (and ButtonPressed and ButtonReleased) events.

Login or register to post comments