Skip to content

Instantly share code, notes, and snippets.

@timanrebel
Created June 24, 2013 09:37
Show Gist options
  • Save timanrebel/5848926 to your computer and use it in GitHub Desktop.
Save timanrebel/5848926 to your computer and use it in GitHub Desktop.
We use one codebase for our iOS and Android app and like to reuse as much code as possible. It is not possible however to use a Widget inside a <Menu> tag, but you can inside a <RightNavButton>. It would really simplify our lives if we could use Widgets and generalize our MenuBar buttons across platforms. I do get the following error however: [E…
<Alloy>
<Window>
<RightNavButton>
<Widget src="sc.MenuBarButton" title="Save" onClick="onSave" />
</RightNavButton>
<Menu>
<Widget src="sc.MenuBarButton" title="Save" onClick="onSave" />
</Menu>
</Window>
</Alloy>
<Alloy>
<Button id="button" onClick="onClick" platform="ios" />
<MenuItem id="buton" onClick="onClick" platform="android" />
</Alloy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment