-
2 Oct 2012 9:56 AM #1
Answered: Vertically Align List Disclosure Icon.
Answered: Vertically Align List Disclosure Icon.
Hello Everyone,
I have a list with a custom itemTpl. I would like to have the disclosure icon vertically aligned in the middle of the x-list-item-label(?). I have tried all sorts of CSS voodoo but can't seem to get it to work. Below is the absurdly sized image of what I am talking about. Here is an example of CSS that I tried that failed miserably while the disclosure icon laughed back at me.
Any help is greatly appreciated.Code:.navigation_list .x-list-item { display: -webkit-box; -webkit-box-orient: horizontal; /* The content of the body is horizontally centered */ -webkit-box-pack: start; /* and vertically as well ... \o/ */ -webkit-box-align: center; width: 100%; height : 100%; } .navigation_list .x-list-item { width: 100%; } .navigation_list .x-list-item .x-list-disclosure { vertical-align: middle; position: static; }
ListDisclosureIconMisbehavior.png
-
Best Answer Posted by UbuntuPenguin
The answer went something like this. The icon is still off center, but I can fight with it to get it right.
And my template looks like thisCode:.navigation_box { display: -webkit-box; -webkit-box-orient: horizontal; /* The content of the body is horizontally centered */ -webkit-box-pack: start; /* and vertically as well ... \o/ */ -webkit-box-align: center; width: 100%; height : 100%; } .navigation_image{ background: #eee; background-size: cover; background-position: center center; width: 80px; height: 80px; } .navigation_text{ vertical-align: middle; flex : 1; } /*.navigation_list .x-list-item*/ /*{*/ /*display: -webkit-box;*/ /*-webkit-box-orient: horizontal;*/ /* The content of the body is horizontally centered */ /*-webkit-box-pack: start;*/ /* and vertically as well ... \o/ */ /*-webkit-box-align: center;*/ /*width: 100%;*/ /*height : 100%;*/ /*}*/ .navigation_list .x-list-item { display: -webkit-box; -webkit-box-orient: horizontal; -webkit-box-pack: center; -webkit-box-align: center; } .x-list-item-label { width: 100pc; } .x-list .x-list-item{ display: -webkit-box; -webkit-box-orient: horizontal; -webkit-box-pack: center; -webkit-box-align: center; } .x-list .x-list-disclosure { bottom: 45%; }
Code:itemTpl: '<div class="navigation_box">' + '<img class="navigation_image" src={ imageLocation }/>' + '<div class="navigation_text">{navigationName}</div>' + '<div>'
-
2 Oct 2012 8:07 PM #2
The answer went something like this. The icon is still off center, but I can fight with it to get it right.
And my template looks like thisCode:.navigation_box { display: -webkit-box; -webkit-box-orient: horizontal; /* The content of the body is horizontally centered */ -webkit-box-pack: start; /* and vertically as well ... \o/ */ -webkit-box-align: center; width: 100%; height : 100%; } .navigation_image{ background: #eee; background-size: cover; background-position: center center; width: 80px; height: 80px; } .navigation_text{ vertical-align: middle; flex : 1; } /*.navigation_list .x-list-item*/ /*{*/ /*display: -webkit-box;*/ /*-webkit-box-orient: horizontal;*/ /* The content of the body is horizontally centered */ /*-webkit-box-pack: start;*/ /* and vertically as well ... \o/ */ /*-webkit-box-align: center;*/ /*width: 100%;*/ /*height : 100%;*/ /*}*/ .navigation_list .x-list-item { display: -webkit-box; -webkit-box-orient: horizontal; -webkit-box-pack: center; -webkit-box-align: center; } .x-list-item-label { width: 100pc; } .x-list .x-list-item{ display: -webkit-box; -webkit-box-orient: horizontal; -webkit-box-pack: center; -webkit-box-align: center; } .x-list .x-list-disclosure { bottom: 45%; }
Code:itemTpl: '<div class="navigation_box">' + '<img class="navigation_image" src={ imageLocation }/>' + '<div class="navigation_text">{navigationName}</div>' + '<div>'


Reply With Quote