zoukankan      html  css  js  c++  java
  • 【译】Android平台上的Flex开发(2) 添加“Hello World”

    添加基本的界面元素

    打开HelloWorldView.mxml,在</s:View> 前加入以下代码


    添加之后代码如图所示。在容器VGroup中,有一个label,文字是“Hello、World”,还有一个按钮,文字是“Contiune”,当按钮按下后,将出现一个新的View。Code to display the 'Hello World!' text on the screen


    创建新的View
    1、File > New > MXML Component,显示New MXML Component对话框
    2、确认Source Folder是“HelloWorld/src”
    3、Package输入“views”
    4、Name输入“MyNewView”
    5、Layout为None
    6、Based on选择“spark.components.View”
    如下图
    Creating the MyNewView view


    在新的View中设定UI元素
    1、打开MyNewView.xml
    2、同样,在</s:View>之前,加入以下代码

    以下是最终的代码。在这个View里,有一个label,文本是Success,一个文字为Back的按钮。其代码将导致回到前一个View

    Code to display the "Success!" text on the second screen


    现在可以进行测试了


     

  • 相关阅读:
    ZOJ3861 Valid Pattern Lock
    ZOJ 3866 Cylinder Candy
    hdu 1729 Stone Game SG函数
    hdu 2546 饭卡 01背包
    hdu 2084 数塔
    中国科学院大学生创新实践训练计划-
    中国科技论文在线期刊模板出现了格式问题,怎么解决?
    1015. 德才论 (25)
    1014. 福尔摩斯的约会 (20)
    Ubuntu 14.0的安装及联网
  • 原文地址:https://www.cnblogs.com/zz962/p/2209690.html
Copyright © 2011-2022 走看看