레이아웃과 중력 속성을 사용하여 다른 해상도의 뷰를 중앙에 배치하려고하지만 작동하지 않습니다. 다른 해상도에서 가로로 사용자 지정보기 센터를 만드는 방법이 있습니까?Android에서 맞춤보기를 중앙에 배치하는 방법은 무엇입니까?
onMeasure 메소드에서 어떤 작업을 수행해야합니까? 여기
내가 지금 노력하고있는 것들 중 하나입니다,보기는 가정
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="50dp"
android:gravity="center_horizontal">
<com.application.app.ui.CustomView
android:id="@+id/ivCoinAnimation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"/>
</RelativeLayout>
</FrameLayout>
시도한 것을 보여줄 수 있습니까? 중첩 된 LinearLayouts 및 중력 속성을 사용하여 뷰를 가운데에 맞출 수 있어야합니다. – henrik
내가 시도한 것들 중 몇 가지 예를 추가했습니다. – tresnotas