我正在使用相对布局创建自己的自定义操作栏。我添加了一个进度条一个按钮和一个带有布局的 SrcollView。使用 Java,我将文本添加到此布局中,但文本仅水平显示一半。为什么?
https://www.dropbox.com/s/7zsvrg3cia379km/Screenshot_2013-05-31-16-54-02.png
<?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:gravity="center_vertical"
android:orientation="horizontal" >
<HorizontalScrollView
android:id="@+id/scroll_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/progressBar"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_margin="1dp"
android:layout_toLeftOf="@+id/actionsearch"
android:fillViewport="true"
android:scrollbars="none" >
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="match_parent" >
<LinearLayout
android:id="@+id/directory_buttons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal" >
</LinearLayout>
</FrameLayout>
</HorizontalScrollView>
<ImageButton
android:id="@+id/actionsearch"
style="?android:attr/actionButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_gravity="right|center_vertical"
android:contentDescription="@string/desc"
android:src="@drawable/search" />
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/actionsearch"
android:fillViewport="true"
android:indeterminateBehavior="repeat" />
</RelativeLayout>