私のlistadapterコードで、私は私の意見をインデントしたいと思います。これを行うには、いくつかの左パディングを追加しますが、それはうまくいくようです。listadapterのgetview
EDIT:main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout
android:layout_width="80dip" android:layout_height="fill_parent"
android:gravity="right|center_vertical">
<ImageView android:id="@+id/item_image" android:layout_width="wrap_content"
android:src="@drawable/icon" android:layout_height="wrap_content"></ImageView>
</LinearLayout>
<FrameLayout android:id="@+id/frame"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1" >
</FrameLayout>
</LinearLayout>
パディングが動作しない理由を任意の提案?画像x dpを右に移動したい。
@Override
public final View getView(final int position, final View convertView, final ViewGroup parent) {
if (convertView == null) {
final LinearLayout layout = (LinearLayout) layoutInflater.inflate(R.layout.main, null);
layout.setPadding(100, 8,8,8);
return layout;
} else {
//do stuff
}
}
XMLファイルの参照を取っているおかげ
main.xmlファイルの内容は何ですか?あなたは詰め物がそれが適用されている "箱"の位置や大きさを変えないと知っていますか?これは "内部マージン"にのみ適用されるため、main.xmlに他のビューが含まれている場合にのみ表示されます。 – darma
レイアウトファイルがなければ、私たちはあなたを助けることができません – Janusz