2011-09-11 6 views
0

下記の画像ごとにアプリケーションUIを作成したいと思います。誰もここに私を案内してください私はこれを達成することができますか?ここボタンとテキストビューのアンドロイドレイアウトの問題

enter image description here
Image Source

123メガバイト、456メガバイトのようなデータは動的であり、アプリケーション自体から変化し続けるであろう。したがって理想的には2つのボタンがあり、特定のボタンの内側にはアップロード/ダウンロードを表示するための2つの画像と、帯域幅のカウントを表示するための2つのテキストビューが必要です。

しかし、私はこれがどのように一緒に手配できるのか分かりませんでしたか?

よろしく、 ラジェッシュ

+0

ない大きな問題ラジェッシュ.. あなたは相対的なリニアLayouts..thenの基本的な知識を持っている場合、それはトリックを行います。.. あなたは、Androidを初めて使用する場合は、期待どおりに動作し –

答えて

0

あなたは複数のネストされたLinearLayoutsを使用することができます。このような何か:

<LinearLayout android:orientation="horizontal" 
    android:layout_height="wrap_content" 
    android:layout_width="fill_parent"> 

    <TextView android:text="MOBILE" 
     android:layout_height="wrap_content" 
     android:layout_width="0" 
     android:layout_weight="0.25" /> 

    <LinearLayout android:orientation="vertical" 
     android:layout_height="wrap_content" 
     android:layout_width="0" 
     android:layout_weight="0.25"> 

     <TextView android:text="123 MB" 
      android:drawableLeft="@drawable/arrow_down" 
      android:layout_height="wrap_content" 
      android:layout_width="fill_parent" /> 

     <TextView android:text="456 MB" 
      android:drawableLeft="@drawable/arrow_up" 
      android:layout_height="wrap_content" 
      android:layout_width="fill_parent" /> 

    </LinearLayout> 

    <TextView android:text="WIFI" 
     android:layout_height="wrap_content" 
     android:layout_width="0" 
     android:layout_weight="0.25" /> 

    <LinearLayout android:orientation="vertical" 
     android:layout_height="wrap_content" 
     android:layout_width="0" 
     android:layout_weight="0.25"> 

     <TextView android:text="123 MB" 
      android:drawableLeft="@drawable/arrow_down" 
      android:layout_height="wrap_content" 
      android:layout_width="fill_parent" /> 

     <TextView android:text="456 MB" 
      android:drawableLeft="@drawable/arrow_up" 
      android:layout_height="wrap_content" 
      android:layout_width="fill_parent" /> 

    </LinearLayout> 


</LinearLayout> 

EDIT:LinearLayoutのいずれかがclickableに設定することができ、onClickListenerとあなたがそれに任意のアクションを登録することができます。

+0

そのあなたのレイアウトをクリアしてみてください。ありがとうございました。 –

関連する問題