가 나는 ConstraintLayout의 텍스트 뷰와 순서, 수평으로 조직 된 버튼,이 사용할 수 무엇에 필요한 공간을 차지 요소 유무 : ConstraintLayout -
내가 첫 번째 요소 (텍스트 뷰)가 필요를 취할 텍스트가 충분히 짧을 때 필요한 공간 만 필요하지만 더 많은 텍스트를 표시해야하는 경우 필요에 따라 확장해야하며 두 번째 요소 (Button)가 뷰 내부에서 완전히 렌더링되도록 공간을 남겨두고 끝은 끝으로 맞 춥니 다. 부모의
이
은 XML이 현재 모습입니다 같은 :<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp">
<TextView
android:id="@+id/element1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Short enough text"/>
<Button
android:id="@+id/element2"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:drawableLeft="@drawable/element2ButtonDrawable"
android:drawablePadding="0dp"
android:drawableStart="@drawable/element2ButtonDrawable"
android:text="Action"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/element1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintHorizontal_bias="0.0"/>
</android.support.constraint.ConstraintLayout>
이 "바닥의 대부분이 외부 밀어 얻을 수있는 긴 텍스트의 원인이됩니다 해당 방법"짧은 충분한 텍스트 "로 전환 할 때 나무가 렌더링입니다 부모 뷰 경계 "의 :
그것은 내가 ConstraintLayout를 사용하여 할 노력하고있어 달성 할 수 있습니까?
감사합니다 (글을 쓰는 시점에서 최신 버전은 1.0.2이다)! 이 같은
안드로이드가 : 최대 길이 텍스트 뷰에 대한 = "maxNumberOfChars"그러나이되지 않습니다 서로 다른 화면 크기를 처리하십시오. – LSA
예, 현재 해결 방법이며 정확하게 현재 문제입니다.><감사합니다! – droid256
코드에 액세스 할 수 있습니까? –