LinearLayout에 TextView가 있습니다. 텍스트 뷰의 XML 우리가 텍스트로 설정 한 텍스트 뷰를 볼 수있는 권리에Android : TextView에서 이상한 텍스트 배치 문제
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/CLOUDS"
android:ellipsize="none"
android:maxLines="100"
android:minHeight="20dp"
android:minLines="1"
android:layout_margin="0dp"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:paddingTop="0dp"
android:textSize="14sp"
android:paddingBottom="0dp"
android:layout_weight="10"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:singleLine="false"
android:scrollHorizontally="false"
android:inputType="textCapSentences|textMultiLine"
/>
: "Campanario 블랑코 \ nMistral 아이스 \ nMistral" 마지막 단어가 표시되지 않습니다.
왼쪽에는 무게가 10 인 다른 텍스트 뷰가 있습니다. 둘 다 선형 레이아웃 내에 배치됩니다.
LinearLayout linearLayout = new LinearLayout(context.mContext);
LinearLayout.LayoutParams ll = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ll.topMargin = 2;
ll.bottomMargin = 0;
linearLayout.setOrientation(LinearLayout.HORIZONTAL);
linearLayout.setLayoutParams(ll);
linearLayout.setPadding(0, 0, 0, 0);
bubble.addView(linearLayout);
가 지금은 "Campanario 블랑코 \ nMistral 아이스 \ nMistral \ nMalibu"에 대한보기의 내용을 변경하는 경우 이제 '미스트랄'표시되지만 새로운 마지막 작품 'Mailbu은'아니다. 총 라인 카운트를 나타내는 바와 같이
는 \ n의 합이지만 고려 제 문자열의 배치를 고려하지 않는다. 긴 텍스트를 제거하면 예상대로 작동합니다. "미스트랄 아이스 \ nMistral \ nMalibu"
어디에서 줄 수를 설정합니까? – jaibatrik
줄 수가 없습니다. 높이를 wrap_text로 설정했습니다. 줄 수에 대한 정보는 자동 줄 바꿈이 어떻게 처리되었는지에 대한 공제입니다. – eddie
이상한. 임시 해결책으로 추가 개행을 추가 할 수 있습니다. TextView와 버그? – jaibatrik