사용자 지정 배열 어댑터에서 작업 중입니다. 텍스트가 더 커지면 축소 된 확장 된 텍스트 뷰를 사용하고 있습니다.동적으로 TextView 여백을 배열하십시오.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/white"
android:orientation="horizontal"
android:weightSum="3" >
<LinearLayout
android:id="@+id/textLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1.8"
android:orientation="horizontal" >
<LinearLayout
android:id="@+id/textLabelLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1.0"
android:orientation="vertical" >
<ft.mobile.client.android.widget.AutoResizeTextView
android:id="@+id/accountNameLabel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:maxLines="1"
android:text="ROPL-12345111000"
custom:dataType="account"
custom:maxLineCount="2"
custom:minFontSize="10"
custom:preferredLineCount="1"
custom:shrinkTextToFit="true" />
</LinearLayout>
<LinearLayout
android:id="@+id/textValueLayout"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginBottom="10dp"
android:layout_marginLeft="05dp"
android:layout_marginRight="05dp"
android:layout_marginTop="10dp"
android:layout_weight="1.2"
android:orientation="horizontal" >
<TextView
android:id="@+id/accountBalanceLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:drawableRight="@drawable/drill_down"
android:ellipsize="none"
android:singleLine="false"
android:text="Amount"
android:textColor="@color/black"
android:textSize="14dp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
것은이 첫 번째 텍스트 뷰가 큰 경우 만 해당 텍스트 뷰의 앞에 존재하는 텍스트 뷰를 통해 오는 것입니다 다음과 같이 내 목록보기 항목 레이아웃입니다.
LayoutParams params = new LayoutParams(
LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT
);
params.setMargins(left, top, right, bottom);
yourbutton.setLayoutParams(params);
당신이 RelativeLayout.LayoutParams
를 사용하거나해야 사용중인 레이아웃에 따라 : 난 그냥 그냥 그렇게 할 수있는의 LayoutParams를 사용하여 바닥