开发者

How can I center emptyText in the middle of the screen in a List in Sencha Touch?

I recently discovered the emptyText config value for lists in Sencha Touch to display when the store is empty. The problem I am having is that this text appears in the top left corner and 开发者_如何转开发I can't seem to find a way to place it in the middle of the screen.

How can I center emptyText in the middle of the screen in a List in Sencha Touch?


The emptyText property accepts HTML. Example:

CSS: 
.emptyText {
    text-align:center;
    color: #999;
}


JS:
emptyText: '<div class="emptyText">No members yet</div>'

For vertical centering you will have to use the CSS3 Flexible box model

Example CSS:

//vertical and horizontal centering based on fixed height
    height:200px;  
    display:-webkit-box;
    -webkit-box-orient: horizontal;        
    -webkit-box-align:center;
    -webkit-box-pack:center;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜