I am trying to align mid of the screen of an item simply a label
but it is aligning it horizontally not vertically.
var panel = new Ext.Panel({
layout:{
type: 'vbox',
align: 'center'
},
items:[
{
xtype: 'label',
html: 'My Label'
}
],
fullscreen: true,
flex: 1
});
I have removed flex
, and set height
as well, but it doesn't work. Please give me some clue?
Try using pack: center
in the layout, like this:
var panel = new Ext.Panel({
layout: {
type: 'hbox',
align: 'center',
pack: 'center'
},
items:[
{
xtype: 'label',
html: 'My Label'
}
]
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With