0
我一直在這一塊我的頭撞了一會兒......我不知道爲什麼我的MD工具欄的背景仍然是白色的,即使我改變了CSS 。md-toolbar背景顏色:透明不起作用
我這裏有我的項目的樣本:
http://abc.morado.xyz:32782/#/index
我的默認HTML頁面呈現各方面的意見是這樣的:
<div layout="row" class="full-height transparent">
<!-- left sidebar -->
<!--<md-sidenav class="admin-sidebar-left md-sidenav-left md-whiteframe-z2" md-component-id="left" md-is-locked-open="layout.sideMenuSize !== 'hidden' && $mdMedia('gt-sm')" ui-view="sidebarLeft" ng-class="{ 'admin-sidebar-collapsed': layout.sideMenuSize == 'icon' }" ng-mouseover="layoutController.activateHover()" ng-mouseleave="layoutController.removeHover()"></md-sidenav>-->
<!-- main content -->
<div id="admin-panel" layout="column" flex class="transparent">
<!-- loading animation -->
<tri-loader></tri-loader>
<!-- top toolbar -->
<md-toolbar class=" transparent" ng-if="layout.showToolbar" md-theme="{{triSkin.elements.toolbar}}" ui-view="toolbar" ng-class="[layout.toolbarSize,layout.toolbarClass]"></md-toolbar>
<!-- scrollable content -->
<md-content ng-class="layout.contentClass" flex tri-default-content ui-view="content"></md-content>
<div ui-view="belowContent"></div>
</div>
<!-- right sidebar -->
<md-sidenav layout layout-fill class="md-sidenav-right md-whiteframe-z2" md-component-id="notifications" ui-view="sidebarRight"></md-sidenav>
和標題變呈現在我的配置文件中:
.state('triangular.header', {
abstract: true,
views: {
toolbar: {
templateProvider: function($templateCache, $http, triLayout) {
return $http.get(triLayout.layout.toolbarTemplateUrl, {cache: $templateCache })
.then(function(response) {
return response.data;
});
},
controllerProvider: function(triLayout) {
return triLayout.layout.toolbarController;
},
controllerAs: 'vm'
},
content: {
templateProvider: function($templateCache, $http, triLayout) {
return $http.get(triLayout.layout.contentTemplateUrl, {cache: $templateCache })
.then(function(response) {
return response.data;
});
}
},
belowContent: {
template: '<div ui-view="belowContent"></div>'
}
}
})
我已經在網上看到這些解決方案,但他們沒有我的情況下工作...
https://github.com/angular/material/issues/4379
My own styles in angular material ui
如果你去我上面的鏈接,並嘗試用CSS打自己,你會發現在md-toolbar標籤或div標籤裏設置背景只會使背景變成不透明的白色。
謝謝你的幫助!
我沒有看到你看到'#admin-panel'' background-color'是白色的嗎? – Dominooch
對不起,你是對的,它不是那個 - 它只是身體的背景。但我不確定你是如何期待這裏有任何不同的結果 - 當一個元素具有透明背景時,它下面的任何謊言都將「閃耀」,這是很自然的。 – CBroe
那麼,在那種情況下,無論如何要做一個粘性標題工具欄,並沒有任何背景?有點像這個例子嗎? https://projects.invisionapp.com/share/HU6O2XEY7/#/screens/146030680 – Dominooch