我正在实现 Navigation Drawer
,它工作正常,但我想在 RelativeLayout 中放置一个自定义 EditText,但是一些 RelativeLayout
属性,如 layout_centerInParent
丢失了,我无法将它们分配给我的自定义 EditText:
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:id="@+id/search_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@string/activity_search_color">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@string/bg_color" >
<com.xxx.xxx.Buttons.CustomEditText
xmlns:custom="http://schemas.android.com/apk/res/com.xxx.xxx"
android:id="@+id/edt_box"
android:gravity="center|center_vertical"
custom:typeface="bold"
style="@style/edtstyle"
/>
</RelativeLayout>
</FrameLayout>
<ListView android:id="@+id/left_drawer"
android:layout_width="@dimen/nav_width"
android:layout_height="match_parent"
android:layout_gravity="right"
android:choiceMode="singleChoice"
android:divider="@android:color/black"
android:dividerHeight="0.0dp"
android:listSelector="@drawable/selector_nav"
android:drawSelectorOnTop="true"/>
我哪里错了?提前致谢
最佳答案
最后我通过在 FrameLayout 中包含另一个布局 RelativeLayout 解决了这个问题
关于android - 抽屉导航内的 RelativeLayout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20261995/