2011-07-16 13 views
0
私は動作しませんTableLayoutを持っていると私は私が間違っているのか、右にやっていないよかわからないんだけど

ここ 私のレイアウトは、レイアウトはありません右

my person icon I want much larger

は私のレイアウトファイル

です
<TableLayout 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:background="@drawable/wall_paper" 

xmlns:android="http://schemas.android.com/apk/res/android"> 
    <TableRow 
    android:layout_weight="1" 
    android:paddingTop="25dp"> 
    <LinearLayout 
    android:orientation="horizontal"> 
    <TextView android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="@string/name" 
     android:textColor="@color/nb_text" 
     android:layout_marginLeft="20dip"/> 
    <EditText android:id="@+id/name" 
     android:layout_width="150dp" 
     android:layout_height="wrap_content" /> 
    </LinearLayout> 
</TableRow> 

<TableRow android:layout_weight="1"> 
    <LinearLayout 
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent" 
    android:orientation="horizontal"> 
    <Button android:id="@+id/chgPhoto" 
     android:text="@string/newphoto" 
     android:background="@drawable/camera" 
     android:layout_height="40dp" 
     android:layout_width="60dp" 
     android:layout_marginLeft="20dip" 
     android:layout_gravity="left" 
     android:gravity="left"   ></Button> 
    <ImageView 
     android:id="@+id/StuPhoto" 
     android:src="@drawable/person_icon" 
     android:layout_width="100dip" 
     android:layout_height="80dp" 
     android:layout_marginLeft="25dip" ></ImageView> 
    </LinearLayout> 
</TableRow> 

</TableLayout> 

私は人のアイコン、そして得られた写真がはるかに大きいことにしたいとさらに右にシフトしますが私は何も助けていないようにみえます。私は写真のlayout_width /高さを増加させたときに実際には、それは単にそのようなそのスペースにアイコンをシフト:これは動作させる方法について

larger dimensions means shifted down and right

任意のアイデア?親切 - 私はレイアウトが私を混乱させていることを容易に認めます。

答えて

0

あなたのテーブルレイアウトにstretchColumns = "*"を追加してください。右に移動しようとしている画像にlayout_gravityを設定しないのはなぜですか?

0

さまざまなサイズのドロワブルを、私が望むレイアウトに合わせるのではなく、自分のイメージに行き、自分が望むものにスケールアップしました。 それから私は "wrap_parent"またはイメージを拡大/縮小することなく何でも使用できます。 に行くのが難しいと思われます。別のデバイスでは、より大きなまたは小さいドローブルが必要な場合があります。しかし、サイズを指定すると終わりがなくなります。

関連する問題