Last active
June 13, 2017 17:11
-
-
Save joshtynjala/522c0461ad121607bcf3 to your computer and use it in GitHub Desktop.
Feathers HelloWorld example ported to MXML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<f:Application xmlns:fx="http://ns.adobe.com/mxml/2009" | |
xmlns:f="library://ns.feathersui.com/mxml" | |
theme="feathers.themes.MetalWorksMobileTheme"> | |
<f:layout> | |
<f:VerticalLayout horizontalAlign="center" verticalAlign="middle"/> | |
</f:layout> | |
<f:Button id="button" label="Click Me" | |
triggered="button_triggeredHandler(event)"/> | |
<fx:Script> | |
<![CDATA[ | |
import feathers.controls.Callout; | |
import feathers.controls.Label; | |
private function button_triggeredHandler(event:Event):void | |
{ | |
var label:Label = new Label(); | |
label.text = "Hi, I'm Feathers!\nHave a nice day."; | |
Callout.show(label, this.button); | |
} | |
]]> | |
</fx:Script> | |
</f:Application> |
Make sure the MXML namespace prefix matches on the layout
property and the component where you're trying to pass in the layout. Notice how it's <f:Application>
and <f:layout>
with the f
namespace prefix in my example code. If it were <ns:Application>
, it would need to be <ns:layout>
. The namespace prefix of a property must always match the namespace prefix of the component.
By the way, it appears that I don't get email notifications on Gists, so I didn't see your comment until now. Sorry for the late response.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I tried using in a mobile feathers project and I get the following error : "Could not resolve <f:layout> to a component implementation.", Any ideas? It works if it is a standard flex application.