我創建了一個基本佈局example。它應該顯示或給出一些答案如何使用UI-Router,HTML和CSS。佈局的思路是:
INTE 的index.html<div ui-view=""></div>
我們注入layout.tpl:
<div>
<section class="top">
<div ui-view="top"></div>
</section>
<section class="middle">
<section class="left">
<div ui-view="left"></div>
</section>
<section class="main">
<div ui-view="main"></div>
</section>
</section>
</div>
種而這些風格:
.top { background: #bcd;
position: absolute; height: 100px; width: auto; left: 0; right: 0; top: 0; bottom: auto;
}
.middle {
position: absolute; height: auto; width: auto; left: 0; right: 0; top: 100px; bottom: 0;
}
.left { background: #def;
position: absolute; height: auto; width: 200px; left: 0; right: auto; top: 0; bottom: 0;
}
.main {
position: absolute; height: auto; width: auto; left: 200px; right: 0; top: 0; bottom: 0;
}
而這些states
這個簡單的應用程序:
$stateProvider
.state('app', {
url: '/app',
views: {
'@' : {
templateUrl: 'layout.html',
},
'[email protected]' : { templateUrl: 'tpl.top.html',},
'[email protected]' : { templateUrl: 'tpl.left.html',},
'[email protected]' : { templateUrl: 'tpl.main.html',},
},
})
.state('app.list', {
url: '/list',
templateUrl: 'list.html',
})
.state('app.list.detail', {
url: '/:id',
views: {
'[email protected]' : {
templateUrl: 'detail.html',
controller: 'DetailCtrl'
},
},
})
檢查它here
這不是一個angularjs問題;這是一個CSS問題。檢查你的CSS規則。 – tyler 2014-11-23 00:41:18
我試過多個選項,但都是徒勞的..就像將最小高度設置爲100%一樣。我還有什麼可以嘗試.. – Darwesh 2014-11-23 00:47:58
你必須發佈你的CSS讓我們知道發生了什麼。如果你可以發佈一個顯示問題的jsfiddle或plunkr,那麼它會有很大的幫助。 – tyler 2014-11-23 00:53:03