私は、行が移入されたListViewを持っています。これらの行が見えるXMLファイルから来る:LinearLayout layout_weight
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="8dip"
android:weightSum="100">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/columnA"
android:layout_weight="30"
android:layout_gravity="center"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/columnB"
android:layout_weight="30"
android:layout_gravity="center"/>
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:src="@drawable/icon"
android:id="@+id/columnC"
android:layout_weight="10"
android:layout_gravity="center"
>
</ImageView>
<CheckBox
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/columnD"
android:layout_weight="30"
android:layout_gravity="center"/>
私の行が均等に3に間隔をあけているように、問題は、私はcolumnC項目とcolumnB項目は一緒に非常に近いようにしたいということですすなわち、columnA、(columnB + columnC)、columnDの順となります。私はあなたが見ることができるようにlayout_weightを使用してこれを達成しようとしましたが、上記のコードは反対の効果を持っているようです。 columnAとcolumnBは左に非常に押しつぶされ、C列はそれ自身の大きなスペースに浮かんでいるように見え、columnDはcolumnCの近くに位置しています。私は間違って何をしていますか? :s
私にそれを打つ、どのくらいのことでも気づかなかった...ちょっとだけ "Load 1 new answer"を得られなかった私が投稿する前に。 – Maximus
お互いのおかげで、これは間違いなく良く見えますが、columnDはcolumnCに近づきすぎていて、右側に余分なスペースがあります。■チェックボックスとは何か関係があります。 –
大丈夫 - この残りの問題を解決するために、線形レイアウトでチェックボックスをラップして、線形レイアウトに重力と重力を設定しなければならなかったことが分かります。どうも! –