저는 해결책을 찾기 위해 노력해 왔으며, FrameLayout
또는 RelativeLayout
이 사용되는 솔루션 만 찾고 LinearLayout
을 사용하고 있습니다.안드로이드 - 화면 중앙에있는 포 그라운드 이미지를 설정하는 방법은 무엇입니까?
내가하고자하는 것은 이미지를 포어 그라운드에 표시하여 페이지에 어떤 것이로드되기 전에 "기다려주십시오"라고 말합니다. 그리고 나는 그 이미지를 중심에 놓으려고 노력하고 있고, 다른 페이지 요소를 바꾸지 않으려 고합니다. 그래서 전 포 그라운드에서 그것을 필요로합니다. 맞습니까?
어떻게하면됩니까?
<ImageView
android:id="@+id/please_wait"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/please_wait"
android:foregroundGravity="center|fill_horizontal" />
하지만 이미지를 중심으로하지 않고 전경에 넣어되지 않은 : 지금은이 있습니다.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<include android:id="@+id/header"
layout="@layout/header"
android:layout_height="wrap_content"
android:layout_width="fill_parent"/>
<ImageView
android:id="@+id/please_wait"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/please_wait"
android:foregroundGravity="center|fill_horizontal"
/>
<TextView
android:id="@+id/problem_loading_prompt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Getting the business(es) you are planning. They are stored in a database that is constantly backed up so you do not lose your work."
/>
<ListView
android:id="@android:id/list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@+id/label"
android:textSize="17sp">
</ListView>
<Button
android:id="@+id/add_problem_ok"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="@color/light_best_blue"
android:text="Plan a New Business"
android:layout_marginTop ="15dp"
/>
</LinearLayout>
감사 :
여기에 전체 XML 파일입니다!
전체 xml 파일에 붙여 넣을 수 있습니다. pls .. –
@ Rahmathullah M Pulikkal 방금 붙여 넣기 - 감사합니다. – Genadinik
로드하는 동안 다른 구성 요소가 숨겨집니다. 권리? –