レイアウトの残っているものを埋める作る:彼らは真ん中のTextViewがレイアウトの残っているものを埋める必要があり、このようなレイアウトを持っている場合ハウツー要素はこれまでのところ、私はこのレイアウトのコードを持って
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="48dip"
android:background="#FFFFFF" >
<ImageView
android:layout_weight="1"
android:layout_width="40dip"
android:layout_height="40dip"
android:layout_gravity="center_vertical"
android:src="@drawable/icon" />
<TextView
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="text" />
<TextView
android:layout_weight="1"
android:layout_width="40dip"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="text" />
</LinearLayout>
</LinearLayout>
は、人々は何をしますか?ここでは40dip幅のImageViewと40dip幅のTextViewがあります。だから私は左のものを埋めるために中間のTextViewを取得しようとしています。上記のコードは私が得る限りです。私は左に何が残っているのかを補うために中間のTextViewを取得しました。左にあるImageViewを40dipよりも小さくするように設定しました。
ここでは何をしますか? Androidでのレイアウトは簡単ではありません。
私がやりたいことは、マーケットのリストのようなリストを作成することです。左にアイコン、中央に2行のテキスト、右に追加の情報があります。これを行う方法の例はありますか?
私は、次のレイアウトは何をしたいあなたを与えるだろうと思い
Thanx!私は今、そのトリックが何であるかを見ます。ストレッチする必要がある要素に対してのみlayout_weightを設定します。私は3つの要素すべてでそれを持っていた。 – Espen