2024年Java最全微信小程序开发入门篇(二),2024年最新大厂Java面试笔试题目

本次面试答案,以及收集到的大厂必问面试题分享:

字节跳动超高难度三面java程序员面经,大厂的面试都这么变态吗?

本文已被CODING开源项目:【一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码】收录

需要这份系统化的资料的朋友,可以点击这里获取

Page:({

data: {

listObj: [

{

title:“标题”,

time:“2021-09-18”

},{

title:“标题2”,

time:“2021-09-18”

},{

title:“标题3”,

time:“2021-09-18”

}

]

}

})

1.3.2、wx:key

  • 我们在使用 wx:for 时,最好加一个 wx:key='*this'

  • 或者加一个 wx:key="index"

{ {item.title}} - { {item.time}}

{ {item.title}} - { {item.time}}

2、WXSS样式

==========================================================================

2.1、小程序适配方案


  • 小程序适配单位:rpx (responsive pixel 响应式像素单位)

  • 规定任何屏幕下宽度为 750rpx

  • 在iPhone 6 下 1rpx = 0.5px,小程序会根据屏幕的宽度不同自动计算 rpx 值的大小

  • 我们一般设计规范都是依据 iPhone 来设计的,也就是说平时 UI 设计师给出的 1px 我们写代码时要写 0.5rpx。(也就是用 px / 2 来得到我们对应的 rpx 大小)。

2.2、样式导入


使用@import语句可以导入外联样式表,@import后跟需要导入的外联样式表的相对路径,用;表示语句结束。

/** common.wxss **/

.small-p {

padding:5px;

}

/** app.wxss **/

@import “common.wxss”;

.middle-p {

padding:15px;

}

2.3、内联样式


框架组件上支持使用 style、class 属性来控制组件的样式。

  • style:静态的样式统一写道 class 中。
  • class:用于指定样式规则,其属性值是样式规则中类选择器名(样式类名)的集合,样式类名不需要带上.,样式类名之间用空格分隔。

目前支持的选择器有:

| 选择器 | 样例 | 样例描述 |

| — | — | — |

| .class | .intro | 选择所有拥有 class=“intro” 的组件 |

| #id | #firstname | 选择拥有 id=“firstname” 的组件 |

| element | view | 选择所有 view 组件 |

| element, element | view, checkbox | 选择所有文档的 view 组件和所有的 checkbox 组件 |

| ::after | view::after | 在 view 组件后边插入内容 |

| ::before | view::before | 在 view 组件前边插入内容 |

需要注意的是小程序是不支持通配符 *

3、事件

======================================================================

事件分为冒泡事件和非冒泡事件:

  1. 冒泡事件:当一个组件上的事件被触发后,该事件会向父节点传递。

  2. 非冒泡事件:当一个组件上的事件被触发后,该事件不会向父节点传递。

  • 19
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
160个项开发实例,聊天项,小游戏适和新手学习(项采用GBK编码)。 import java.util.*; import java.io.*; import java.awt.*; import java.awt.event.*; import java.applet.*; import javax.swing.*; class Gobang extends JFrame implements Runnable, ActionListener { final static int Player=1; final static int AI =-1; ClassLoader cl = this.getClass().getClassLoader(); Toolkit tk = Toolkit.getDefaultToolkit(); int length=14, game_state, winner, check, step; int grid[][] = new int[length][length]; int locX, locY /* 囱竚 */, count /* 硈囱计 */, x, y /* 既竚 */, displace_x=0, displace_y=0 /* 簿秖 */, direction; ArrayList steps = new ArrayList(); /* 癘魁囱˙ */ JPopupMenu control_menu = new JPopupMenu(); /* 龄匡虫 */ JMenuItem[] command = new JMenuItem[4]; String[] command_str={"囱", "郎", "弄郎", "秨"}; int[][] dir = { {-1, -1}, {-1, 0}, {-1, 1}, {0, -1}, {0, 1}, {1, -1}, {1, 0}, {1, 1} }; boolean[] dir2 = new boolean[8]; boolean turn; String message; final JDialog dialog = new JDialog(this, "叫匡", true); Font font=new Font("new_font", Font.BOLD, 20); Grid grids[][] = new Grid[length][length]; Image white= tk.getImage(cl.getResource("res/white.png")); Image black= tk.getImage(cl.getResource("res/black.png")); Image title= tk.getImage(cl.getResource("res/title.png")); Image temp; JPanel boardPanel, bigpanel; JRadioButton[] choice = new JRadioButton[2]; final static int Start =0; final static int Select =1; final static int Playing =2; final static int End =3; final static int nil=-1; /* 礚よ */ final static int oblique_1 =0; /* オ */ final static int oblique_2 =1; /* オ */ final static int horizontal =2; /* 绢 */ final static int vertical=3; /*  */ Gobang() { super("き囱"); boardPanel = new JPanel(); boardPanel.setLayout(new GridLayout(length, length, 0, 0)); boardPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); for(int i=0; i<length; i++) for(int j=0; j<length; j++) {
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值