Dart 如何使用锚定布局
我正在努力掌握锚定布局的用法。我有以下代码构造函数:Dart 如何使用锚定布局,dart,rikulo,Dart,Rikulo,我正在努力掌握锚定布局的用法。我有以下代码构造函数: LokationView() { buildCityUi(); buildRegionUi(); } buildCityUi() { cityLbl = new TextView( 'City' ); addChild( cityLbl ); cityTxBx = new TextBox( null, 'text' ) ..profile.width = 'flex ' ..profile.ancho
LokationView()
{
buildCityUi();
buildRegionUi();
}
buildCityUi()
{
cityLbl = new TextView( 'City' );
addChild( cityLbl );
cityTxBx = new TextBox( null, 'text' )
..profile.width = 'flex '
..profile.anchorView = cityLbl
..profile.location = 'east center'
..on.layout.listen( (_)
{
cityTxBx.width = 200;
cityTxBx.requestLayout();
});
addChild(cityTxBx );
}
buildRegionUi()
{
regionLbl = new TextView( 'Region' )
..profile.anchorView = cityLbl
..profile.location = 'south start';
addChild( regionLbl );
regionTxBx = new TextBox( null, 'text' )
..profile.width = 'flex 1'
..profile.anchorView = regionLbl
..profile.location = 'east center';
addChild( regionTxBx );
}
我正在努力完成以下工作:
1.创建带有相应文本框视图的标签视图。
2.让文本框视图占据剩余的浏览器空间,视图随浏览器宽度的变化而变化
谢谢主持人不是答案。相反,我会帮忙的