0
help! 나는 (LinearLayout)에서 edittext 필드를 사용하여 프로그래밍 방식으로 활성화 및 비활성화합니다. screenshot 필드를 활성화 및 비활성화 할 때 edittexts 너비에 문제가 없습니다. 문제는 여기안드로이드는 모든 방향을 변경하고 초점을 맞춘 상태에서 편집 텍스트의 폭을 변경합니다.
user clicks to focus on any of the edittexts then the widths of ALL the edittexts become 1 character. 내 editexts 중 하나에 대한 코드입니다 edittexts이 활성화 된 후 오는 중
방향 변경 또는
. 나머지는 동일하며, 이드 만 다릅니다.<EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/purchase_price" android:imeOptions="flagNoExtractUi|actionNext" android:maxLines="1" android:singleLine="true" android:inputType="numberDecimal">
여기에 필드를 사용하도록 설정하는 코드가 있습니다.
public void onCreate(Bundle savedInstanceState) { enabledEdittext = mPurchasePrice.getBackground(); disabledEditext = ContextCompat.getDrawable(this, R.drawable.disabled_edittext); . . . mPurchasePrice.setBackground(enabledEdittext); }
클라이언트가 필드를 사용할 수 없을 때 edittext 아래의 줄을 제거해야하기 때문에 배경을 변경했습니다. – vyxf