2016-07-08 4 views
1

나는 초보자이지만 코드를 사용하여 모바일 앱의 모양을 만들고 싶습니다. 나는 포토샵 이미지를 사용하여 배경을 만들고, 그러나 나는 버튼과에서 다른 모든을 원하는 코드를 여기에 내가 (I 추가 버튼이 표시되지 않습니다)가 무엇인가.코드 명 1에서 코드 주제는 어떻게됩니까?

public void start() { 
     if(current != null){ 
      current.show(); 
      return; 
     } 
     new StateMachine("/theme");   
    } 
    Button customer = new Button("Customer"); 
    Button gpsAntenna = new Button("Find An Antenna Near You"); 
    Button learnMore = new Button("Learn More About NEN Now"); 
    Button nenNow = new Button("NEN Now Webpage"); 
    public void stop() { 
     current = Display.getInstance().getCurrent(); 
     if(current instanceof Dialog) { 
      ((Dialog)current).dispose(); 
      current = Display.getInstance().getCurrent(); 
     } 
    } 

답변

1

당신은에 추가 할 필요가 형태 또는 컨테이너. Form 클래스와 Container 클래스를 살펴보면 둘 다 addComponent() 메서드가 있다고 생각합니다. 그런 다음 양식을 재확인하여 표시되도록 할 수 있습니다.

컨테이너에 추가하는 경우 해당 양식에 추가해야합니다.

+0

Steve의 비디오도 단계별로 살펴 보시기 바랍니다. http://www.codenameone.com/blog/psd-to-app-converting-a-beautiful-design-into-a-native -mobile-app.html 개발자 가이드에서 같은 프로세스를 단계적으로 작성하는 방법 (약간 간략화)을 텍스트로 볼 수 있습니다 (https://www.codenameone.com/manual/advanced-theming.html#_converting_a_psd_to_a_theme –

+0

). 큰 확인! 나는 "getstarted app"테마와 함께 제공된 기존 코드가 나를 혼란스럽게 만들었다 고 생각한다. 모든 기존 코드를 삭제했으며 이제는 최소한의 기본 기능 만 보여줍니다. 감사. –