ConstraintLayout을 사용하여이 레이아웃을 수행하고 싶습니다.ConstraintLayout을 사용하여 TableLayout을 모방합니다.
그러나 나는 그것의 1 (녹색) 부분조차하지 못했습니다.
내가하고 싶은 것은 3 개의 TextViews 1, 2와 3 (분홍색)을 부모의 왼쪽에 연결하고 다른 하나의 아래에 그들에게 말하려한다. 그것은 작동합니다.
그런 다음보기 4와 5를 추가해야합니다. 그러면 그림이 그림과 같이 왼쪽과 오른쪽에 수직으로 정렬되어야합니다.
내가 4와 5에
app:layout_constraintLeft_toRightOf="2 OR 3"
텍스트를 추가 할 때 제대로 정렬되지 않는 문제. 내가 가이드 라인을 사용할 때 나는이
app:layout_constraintLeft_toRightOf="@id/guideline"
사람이 도움을 줄 수 알고 있나요 받기
를 얻을?
편집. 추신 첫 번째 시도의 레이아웃
<android.support.constraint.ConstraintLayout
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:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:id="@+id/constraintLayout"
>
<TextView
android:id="@+id/instrument_name"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:text="AUDUSD"
app:layout_constraintStart_toStartOf="@+id/constraintLayout"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"/>
<TextView
android:id="@+id/trade_action_label"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="BUYjhkjhkjhvg"
app:layout_constraintStart_toStartOf="@+id/instrument_name"
app:layout_constraintTop_toBottomOf="@id/instrument_name"
tools:layout_editor_absoluteX="16dp"
android:layout_marginTop="1dp"/>
<TextView
android:id="@+id/net_pl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Net p/l"
app:layout_constraintStart_toStartOf="@+id/trade_action_label"
app:layout_constraintTop_toBottomOf="@id/trade_action_label"/>
<TextView
android:id="@+id/record_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="123"
app:layout_constraintTop_toTopOf="@id/trade_action_label"
app:layout_constraintLeft_toRightOf="@id/trade_action_label"
tools:layout_editor_absoluteY="33dp"
/>
<TextView
android:id="@+id/pl_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="12"
app:layout_constraintTop_toTopOf="@id/net_pl"
app:layout_constraintLeft_toRightOf="@id/net_pl"/>
</android.support.constraint.ConstraintLayout>
레이아웃을 표시하십시오 - 내가 원하는 것에 가장 가까운 것입니다. – Cheticamp
@Cheticamp이 레이아웃 중 어느 것도 나에게 내가 원하는 것을 제공하지 못한다. – Lanitka
첫 번째 시도해 봅시다. – Cheticamp