2013-05-01 3 views
1

앵커 레이아웃 사용법을 파악하는 데 어려움을 겪고 있습니다. 나는이 완료 다음 얻기 위해 노력하고앵커 레이아웃 사용 방법

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. 브라우저 너비가 변경되면서 다양한보기가있는 브라우저 공간의 나머지 부분을 차지하도록 TextBox보기를 가져옵니다.

감사합니다.

답변

0

AnchorLayout는 답변이 아닙니다. 오히려 LinearLayout이 도움이됩니다.

+0

톰 감사합니다. –