Hi,
Is it possible to insert a carriage return in title in Menu2 ?
I try "\r\n" but it's not recogniazed.
Hi,
Is it possible to insert a carriage return in title in Menu2 ?
I try "\r\n" but it's not recogniazed.
Yes it is, just use "\n"
like
var toggleMenu = new WatchUi.Menu2({:title=>"Toggles\nTest"});
just "\n" in xml resources menus is not recognized : generate a symbol with a "?".
You didn't originally state how you're using Menu2.
As far as I am aware, you cannot specify a newline in an xml resource file.
One possible solution would be to use a special character in the xml - say '|', and then replace that character with '\n' before using it as the title. I've not tried it, but I think that will work.
While I don't think I'd do this in an actual app, I'm able to do this in the simulator without problem when using the 3.1.0.beta3 SDK.
<resources>
<string id="MainMenuTitle">Main\nMenu</string>
<menu2 id="MainMenu" title="@Strings.MainMenuTitle">
<menu-item id="generic1" label="Generic 1" subLabel="With Sublabel" />
<menu-item id="generic2" label="Generic 2" />
</menu2>
</resources>
class Menu2TestDelegate extends WatchUi.BehaviorDelegate {
function initialize() {
BehaviorDelegate.initialize();
}
function onMenu() {
WatchUi.pushView(new Rez.Menus.MainMenu(), new Menu2TestMenu2Delegate(), WatchUi.SLIDE_UP );
return true;
}
}
It does not appear to work with the 3.0.12 SDK. I'm not sure where the issue is (it could be an issue with the resource compiler or the virtual-machine), but if you were to use a 3.1 SDK and deploy to a device with 3.1 support, this should work.
Yes. i though also for this solution. But there is no function "replace" … i need to make it.
Firt i would be know if a "native" solution existed.
Good news … i wait 3.1 sdk :)
Yes, i miss this precision … sorry.
No problem, sounds like there is hope for you with 3.1