Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/205.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 自定义操作栏相对布局子项未正确放置_Android_Android Layout_Android Actionbar_Android Relativelayout - Fatal编程技术网

Android 自定义操作栏相对布局子项未正确放置

Android 自定义操作栏相对布局子项未正确放置,android,android-layout,android-actionbar,android-relativelayout,Android,Android Layout,Android Actionbar,Android Relativelayout,我正在使用以下RelativeLayout创建自定义操作栏。问题是,高度\指示器未显示在动物\视图\标题的右侧。相反,它们看起来是重叠的:两者都位于中心。现在在图形布局上,它看起来是正确的。但当我在我的S4上运行它时,它失败了 <RelativeLayout android:id="@+id/my_rel_view" android:layout_width="match_parent" android:layout_height="match_parent"

我正在使用以下RelativeLayout创建自定义操作栏。问题是,
高度\指示器
未显示在
动物\视图\标题
的右侧。相反,它们看起来是重叠的:两者都位于中心。现在在图形布局上,它看起来是正确的。但当我在我的S4上运行它时,它失败了

<RelativeLayout
    android:id="@+id/my_rel_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:theme="@style/CustomTheme"
    android:visibility="visible" >

    <TextView
        android:id="@+id/animals_view_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:layout_marginRight="10dp"
        android:text="The Animals"
        android:textColor="#DDDDDDDD"
        android:textSize="26sp" />

    <TextView
        android:id="@+id/height_indicator"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_toRightOf="@id/animals_view_title"
        android:drawableRight="@drawable/height_unit"
        android:text="0"
        android:textColor="#FFFFFF"
        android:textSize="10sp" />

    <ImageView
        android:id="@+id/edit_btn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:layout_marginRight="5dp"
        android:layout_marginTop="15dp"
        android:clickable="true"
        android:onClick="editHeight"
        android:src="@drawable/edit_button" />
</RelativeLayout>


animals\u view\u title
中删除,
android:layout\u centerInParent=“true”
,并向其添加
android:layout\u centerVertical=“true”

你有屏幕截图吗?