일단 모든 프로젝트를 ContraintLayout을 사용하여 만들었다.
때문에 LinearLayout에 익숙하지않았고, 사용할일이 없을거라고 생각했다.
게시판을 구현하던도중에
업로드된 이미지가 없으면 글도 이미지뷰가 시작되는 지점까지 올라가서 글을 쓸 수 있도록 하고싶었다.
ContraintLayout으로 프로필 이미지쪽 라인에 관계를 설정해주고 이런저런 테스틀해봤지만..
글과 좋아요 표시부분은 올라가지 않았다,(모든 뷰의 배치가 그대로이면서, 뷰 자리만 공백이 됬다)
그러다가 팀원분의 조언으로 LinearLaout으로 테스트했다.
LinearLayout으로 업로드될 이미지부터 밑에 항목들까지 감싸주고, vertical로 준뒤
visibility = "gone" 으로 테스트했을때, 정상적으로 뷰가 날라갔을때, 이미지뷰 자리부터
상단배치되어 시작하는걸 볼 수 있었다.
<LinearLayout
android:layout_width="409dp"
android:layout_height="560dp"
android:layout_marginStart="1dp"
android:layout_marginEnd="1dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/community_tv_detail_username">
세요