当前位置: 首页 > news >正文

广州网站推广自助摄影师网站建设

广州网站推广自助,摄影师网站建设,私人下载服务器,呢图网站场建设封面9.用户界面的跳转abilityslice的跳转#xff0c;值传递#xff0c;数值累加 首页页面显示1#xff0c;第2页显示2#xff0c;再次点击返回首页3。。。 MainAbilitySlice.java 关键代码#xff1a; 点击事件 text.setClickedListener(new Component.ClickedListener() …9.用户界面的跳转abilityslice的跳转值传递数值累加 首页页面显示1第2页显示2再次点击返回首页3。。。 MainAbilitySlice.java 关键代码 点击事件 text.setClickedListener(new Component.ClickedListener() {Overridepublic void onClick(Component component) {// present(new SecondAbilitySlice(),new Intent());Intent _intent new Intent();_intent.setParam(count,count);presentForResult(new SecondAbilitySlice(),_intent,0x00101);}});}Overrideprotected void onResult(int requestCode,Intent resultIntent){if(requestCode 0x00101){countresultIntent.getIntParam(count,1);text.setText(t1: count);}} MainAbilitySlice.java package com.example.myapplication.slice;import com.example.myapplication.ResourceTable; import com.example.myapplication.slice.slice.SecondAbilitySlice; import ohos.aafwk.ability.AbilitySlice; import ohos.aafwk.content.Intent; import ohos.agp.colors.RgbColor; import ohos.agp.components.Component; import ohos.agp.components.ComponentContainer; import ohos.agp.components.DirectionalLayout; import ohos.agp.components.Text; import ohos.agp.components.element.ShapeElement; import ohos.agp.utils.TextAlignment;public class MainAbilitySlice extends AbilitySlice {private Text text;private int count 1;Overridepublic void onStart(Intent intent) {super.onStart(intent);// super.setUIContent(ResourceTable.Layout_ability_main);ComponentContainer.LayoutConfig config new ComponentContainer.LayoutConfig(ComponentContainer.LayoutConfig.MATCH_PARENT,ComponentContainer.LayoutConfig.MATCH_PARENT);DirectionalLayout layout new DirectionalLayout(this);ShapeElement element new ShapeElement();element.setRgbColor(new RgbColor(255,255,255));//白色layout.setBackground(element);layout.setLayoutConfig(config);//// Text text new Text(this);text new Text(this);text.setLayoutConfig(config);text.setTextAlignment(TextAlignment.CENTER);//text.setText(MainAbilitySlice);text.setText(t1:count);text.setTextSize(100);layout.addComponent(text);super.setUIContent(layout);text.setClickedListener(new Component.ClickedListener() {Overridepublic void onClick(Component component) {// present(new SecondAbilitySlice(),new Intent());Intent _intent new Intent();_intent.setParam(count,count);presentForResult(new SecondAbilitySlice(),_intent,0x00101);}});}Overrideprotected void onResult(int requestCode,Intent resultIntent){if(requestCode 0x00101){countresultIntent.getIntParam(count,1);text.setText(t1: count);}}Overridepublic void onActive() {super.onActive();}Overridepublic void onForeground(Intent intent) {super.onForeground(intent);} }关键代码2 点击事件 SecondAbilitySlice.java text.setClickedListener(new Component.ClickedListener() {Overridepublic void onClick(Component component) {//present(new MainAbilitySlice(),new Intent());Intent resultintent new Intent();resultintent.setParam(count,count);setResult(resultintent);terminate();}}); SecondAbilitySlice.java package com.example.myapplication.slice.slice;import com.example.myapplication.ResourceTable; import com.example.myapplication.slice.MainAbilitySlice; import ohos.aafwk.ability.AbilitySlice; import ohos.aafwk.content.Intent; import ohos.agp.colors.RgbColor; import ohos.agp.components.Component; import ohos.agp.components.ComponentContainer; import ohos.agp.components.DirectionalLayout; import ohos.agp.components.Text; import ohos.agp.components.element.ShapeElement; import ohos.agp.utils.TextAlignment;public class SecondAbilitySlice extends AbilitySlice {private Text text;private Text text2;private int count;Overridepublic void onStart(Intent intent) {super.onStart(intent);count intent.getIntParam(count,1);count;// super.setUIContent(ResourceTable.Layout_ability_main1);ComponentContainer.LayoutConfig config new ComponentContainer.LayoutConfig(ComponentContainer.LayoutConfig.MATCH_PARENT,ComponentContainer.LayoutConfig.MATCH_CONTENT);DirectionalLayout layout new DirectionalLayout(this);DirectionalLayout layout2 new DirectionalLayout(this);ShapeElement element new ShapeElement();element.setRgbColor(new RgbColor(100,100,255));//浅蓝色layout.setBackground(element);layout.setLayoutConfig(config);// element.setRgbColor(new RgbColor(100,255,255));//// layout2.setBackground(element);//text new Text(this);text2 new Text(this);text.setLayoutConfig(config);text.setTextAlignment(TextAlignment.CENTER);text2.setLayoutConfig(config);text2.setTextAlignment(TextAlignment.CENTER);// text.setText(SecondAbilitySlice);text.setText(count);text2.setText(t2:count);text.setTextSize(100);text2.setTextSize(100);layout.addComponent(text);layout.addComponent(text2);super.setUIContent(layout);// super.setUIContent(layout2);text.setClickedListener(new Component.ClickedListener() {Overridepublic void onClick(Component component) {//present(new MainAbilitySlice(),new Intent());Intent resultintent new Intent();resultintent.setParam(count,count);setResult(resultintent);terminate();}});}Overridepublic void onActive() {super.onActive();}Overridepublic void onForeground(Intent intent) {super.onForeground(intent);} }
http://wiki.neutronadmin.com/news/67238/

相关文章:

  • 做网站怎么添加背景图片网站查询域名解析
  • 云南机场建设集团网站租车网站建设
  • 迎访问中国建设银行网站-深圳网站建设哪家好
  • 苏州市建设工程质量监督站网站创建5a 网站建设要求
  • 宝安附近公司做网站建设哪家效益快ppt素材免费网站
  • 内蒙古建设网站模板网建站
  • 怎么在视频网站做淘宝客口碑营销的经典案例
  • 帮别人做彩票网站吗一对一软件
  • 利用wix建手机网站h5网站建设代理
  • 网站设计的一般流程是什么如何做好企业网站建设工作
  • 网站更改备案信息在哪里小程序开发难吗
  • 迅雷网站做爰视频自己有货源怎么找客户
  • 深圳免费模板建站中国建设教育协会的网站查询
  • 做网站后台数据库建设公司网站经常打不开
  • 做海报文案的参考网站asp网站开发教程
  • 培训学校网站系统温州阀门网站建设
  • 网站建设的培训的感受网站seo招聘
  • 建网站需要多少钱项目管理系统软件开发
  • 做网站需要审批不wordpress 模版定制
  • 和君设计专业网站建设公司天津建设工程信息网登录不了
  • 儿童教育网站怎么做有趣巩义网站优化
  • 网站建设 有限公司html教程网站
  • 做物流的都是上什么网站wordpress域名根管
  • 企业网站建设首页要写什么内容怎么设计网页主页
  • 青岛 公司 网站建设湖南搜索引擎推广软件
  • 佛山做网站公司排名泉州seo关键词排名
  • 广州免费建站推荐用腾讯云做会员网站
  • 富顺网站建设做公司子网站的请示报告
  • 暗网是什么网站wordpress 主题 强大
  • 做网站目的对网站建设服务公司的看法