android | 안드로이드 화면별 LinearLayout 가운데위치 정렬
페이지 정보
작성자 굿스웹 작성일20-01-06 17:39 조회1,872회 댓글0건관련링크
본문
layout 디바이스 화면별 가운데 표시할때
res-auto 이용해 자동으로
가운데 표시하자
<androidx.constraintlayout.widget.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:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="9"
android:background="#ffffff"
android:gravity="center_vertical"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
>
<TextView
android:id="@+id/massg_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="가운데"
android:textColor="#000000"
android:textSize="24sp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
#가운데정렬 #안드로이드 #스튜디오
res-auto 이용해 자동으로
가운데 표시하자
<androidx.constraintlayout.widget.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:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="9"
android:background="#ffffff"
android:gravity="center_vertical"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
>
<TextView
android:id="@+id/massg_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="가운데"
android:textColor="#000000"
android:textSize="24sp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
#가운데정렬 #안드로이드 #스튜디오
[주소복사] https://www.goodsweb.kr/?u=D41B2bAC
SNS 알리기
핀터레스트
텔레그램로
블로그로
페이스북
트위터
카카오스토리
카톡 공유
관련 블로그
로딩중