0

複数のコンポーネントを LWUIT フォームに 1 つずつ追加しましたが、問題は、コードに追加したように、追加したコンポーネントを 1 つずつ表示できないことです。日付と画像を 1 つの画面に表示できます。行 (並べて) 1 つの行にタイトルと日付が表示されることがあります。Rss ファイルから詳細を取得しています。コードに1つずつ追加したようなコンポーネントを表示する方法はありますが、2つのコンポーネントを1行に表示することはできませんか?

ありがとう....

ここに私のコード:

 Label pubDate = new Label(detailNews.getPubDate().substring(0, 16));
        Label title=new Label();
        title.setText(detailNews.getTitle());
        title.startTicker();
        pubDate.getStyle().setFont(Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_SMALL));
            Image geImage = detailNews.geImage(); 
        Label icon=new Label(geImage);
                form2.addComponent(title);
                form2.addComponent(pubDate);
        textarea.setText(detailNews.getDescription());
        textarea.requestFocus();
      form2.addComponent(icon);
       form2.addComponent(textarea);
        form2.show();
4

1 に答える 1

2

私の考えは:

ContainerBoxLayoutY で を作成し、これTextAreaとアイコンを に追加できますContainerContainer次に、これをに追加しFormます。何かのようなもの:

       Label pubDate = new Label(detailNews.getPubDate().substring(0, 16));
        Label title=new Label();
        title.setText(detailNews.getTitle());
        title.startTicker();
        pubDate.getStyle().setFont(Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_SMALL));
            Image geImage = detailNews.geImage(); 
        Label icon=new Label(geImage);

        Container container = new Container(new BoxLayout(BoxLAyout.Y_AXIS));
        container.addComponent(title);
        container.addComponent(pubDate);
        container.addComponent(icon);
        container.addComponent(textarea);
        form2.addComponent(container);

        textarea.setText(detailNews.getDescription());
        textarea.requestFocus();
        form2.show();
于 2012-10-11T00:41:45.483 に答える