0
我有一个ViewPager
(标准的一个),它被放在ScrollView
(万一页面将会变大然后屏幕显示,每个页面上我都有一个Spinner
(进度条)用于显示数据加载,Spinner
以页面为中心如何在ViewPager页面大于屏幕的同时在屏幕上居中显示?
但是当页面更大然后筛选Spinner
不集中在屏幕上,因为它为中心的网页上,并Spinner
在屏幕下方(或者竟然隐藏,例如在屏幕下方)。
那么如何设置Spinner
中心屏幕上(不在页面上)?
更新:微调必须在viewpager的页面上,因为每个页面都必须加载一些数据表单服务器,微调器分别指示每个页面的加载过程。
这里是寻呼机的位置:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white" />
</LinearLayout>
这里是一个页面布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true">
<GridView
android:id="@+id/my_gird"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="72dp"/>
<TextView
android:id="@+id/test_text"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="!!!!!!" />
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
/>
</RelativeLayout>
它不能解决我的问题,因为我必须访问查看寻呼机上的进度条表单页面。 – LunaVulpo
@LunaVulpo你不能提供回调吗? – Shark
@Shark也许我可以,但最后我通过编程方式测量屏幕尺寸并将progressBar设置在正确的位置来解决我的问题。 – LunaVulpo