如何将此按钮对齐到屏幕右侧?
我尝试将 style: float: right 添加到按钮,但它不起作用。
myapp.cards.home.add({
xtype: 'button',
id: 'previmagebutton',
// text: 'p',
iconCls: 'arrow_left',
iconMask: true,
style: 'float: right'
});
myapp.cards.home = new Ext.Panel({
scroll: 'vertical',
id: "home-card",
layout:{
type:"vbox",
align:"center"
},
items: [header]
});
myapp.mainPanel = new Ext.Panel({
fullscreen: true,
layout: "card",
cardAnimation: 'slide',
items: [myapp.cards.home]
});
如果这就是导致问题的原因,我必须使用 add 方法。非常感谢。
I've tried adding style: float: right to the button but it isn't working.
myapp.cards.home.add({
xtype: 'button',
id: 'previmagebutton',
// text: 'p',
iconCls: 'arrow_left',
iconMask: true,
style: 'float: right'
});
myapp.cards.home = new Ext.Panel({
scroll: 'vertical',
id: "home-card",
layout:{
type:"vbox",
align:"center"
},
items: [header]
});
myapp.mainPanel = new Ext.Panel({
fullscreen: true,
layout: "card",
cardAnimation: 'slide',
items: [myapp.cards.home]
});
I have to use the add method if that is what's causing the problem. Many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在您的
myapp.cards.home
对象中,您将布局设置为align:"center"
。In your
myapp.cards.home
object you have the layout set up toalign:"center"
.我已经通过使用
按钮上的配置成功创建了一个浮动按钮。由于是私人会员,所以还在寻找官方的方式。
I've succeeded in creating a floating button by using
config on the button. It is a private member, so I'm still looking for an official way.
这应该可以工作::
或者您可以添加一个
spacer
(如果它在工具栏中),或者如果您拉伸
元素,然后添加另一个hbox
元素在其一侧有一个flex
,它占据了您不需要的空间This should work ::
or you can add a
spacer
if its in the toolbar, or if youstretch
the element, then add anotherhbox
element on its side with aflex
that occupies as much space that you don't need