Skip to content

LButton有bug #25

Description

@androids7

这段代码里,我给这个按钮添加了两张图片,显示是正常的。但是按下后就不正常了,是不是case 2里的代码有问题,这是源码
public void setImages(LTexture... images) {
LTexture[] buttons = new LTexture[4];
if (images != null) {
int size = images.length;
this.type = size;
switch (size) {
case 1:
buttons[0] = images[0];
buttons[1] = images[0];
buttons[2] = images[0];
buttons[3] = images[0];
break;
case 2:
buttons[0] = images[0];
buttons[1] = images[1];
buttons[2] = images[0];
buttons[3] = images[0];
break;
case 3:
buttons[0] = images[0];
buttons[1] = images[1];
buttons[2] = images[2];
buttons[3] = images[0];
break;
case 4:
buttons = images;
break;
default:
exception = true;
break;
}
}
if (!exception) {
this.setImageUI(buttons, true);
}

}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions