java psd 转jpg_PSD转APP应用(材料PSD)

我试图在我的应用程序上创建一个登录屏幕,看起来像城市指南登录屏幕(2):

我从Materiall Design Demo和PSD To App Revisited博客的博客中使用了以下代码:

f = new Form(new BorderLayout());

f.setUIID("loginForm");

f.getTitleArea().setUIID("Container");

f.getToolbar().hideToolbar();

Label logo = new Label();

logo.setIcon(theme.getImage("logoHolder.png"));

Container titleContainer = Container.encloseIn(

new BorderLayout(BorderLayout.CENTER_BEHAVIOR_CENTER),

logo, BorderLayout.CENTER);

titleContainer.setUIID("loginTitleContainer");

TextField login = new TextField("", "Your email address", 40, TextField.EMAILADDR);

TextField password = new TextField("", "Your password", 40, TextField.PASSWORD);

login.getAllStyles().setMargin(LEFT, 0);

password.getAllStyles().setMargin(LEFT, 0);

Label loginIcon = new Label("", "TextField");

Label passwordIcon = new Label("", "TextField");

loginIcon.getAllStyles().setMargin(RIGHT, 0);

passwordIcon.getAllStyles().setMargin(RIGHT, 0);

FontImage.setMaterialIcon(loginIcon, FontImage.MATERIAL_MAIL_OUTLINE, 3);

FontImage.setMaterialIcon(passwordIcon, FontImage.MATERIAL_LOCK_OUTLINE, 3);

Button loginButton = new Button();

loginButton.setIcon(theme.getImage("login_login.png"));

loginButton.setUIID("removePadding");

Button exitButton = new Button();

exitButton.setIcon(theme.getImage("login_exit.png"));

exitButton.setUIID("removePadding");

Button forgotButton = new Button("Forgot password?");

forgotButton.setUIID("forgotPass");

Label vSpacer = new Label();

vSpacer.setUIID("longVSpacer");

Label vSpacer1 = new Label();

vSpacer1.setUIID("longVSpacer");

Label vSpacer2 = new Label();

vSpacer2.setUIID("vSpacer");

Label vSpacer3 = new Label();

vSpacer3.setUIID("vSpacer");

Container loginCon = BoxLayout.encloseY(

vSpacer1,

BorderLayout.center(login).

add(BorderLayout.WEST, loginIcon),

BorderLayout.center(password).

add(BorderLayout.WEST, passwordIcon),

vSpacer,

loginButton,

vSpacer2,

exitButton,

vSpacer3,

forgotButton

);

f.add(BorderLayout.NORTH, titleContainer);

f.add(BorderLayout.CENTER, loginCon);

f.show();

现在,对于UIID,“removePadding”将所有填充设置为零,并将左边距设置为3 .

vSpacer设置了顶部和底部边距,以便允许垂直的合理空间 .

当我没有将文本字段添加到框布局时,一切正常,但是一旦我向框布局添加任何文本字段,北容器就会从左右收缩,并且它不会覆盖整个宽度 .

但是当从框布局中删除文本字段并添加按钮时,例如北容器覆盖整个宽度 .

我尝试使用按钮UIID“removePadding”填充和边距,但没有运气 .

以下是在边框布局中添加文本字段以及图标时我的屏幕的样子:

7c72517fdafd39cc770765ec00a951e5.png

当我从框布局中取下文本字段并且只留下按钮时,这就是我的屏幕的样子:

5335d5f71a0b844c616cb4d30e353e09.png

此外,文本字段在未选择的UIID上都具有下划线图像 . 但是当电子邮件字段未被选中时,它不会获得下划线外观,并且只有密码字段在未被选中时加下划线 . 这看起来像个错误!!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值