在Android RelativeLayout中,maxWidth不';行不通

在Android RelativeLayout中,maxWidth不';行不通,android,layout,Android,Layout,我在内容中获得了RelativeLayout: <RelativeLayout xmlns: android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" an

我在内容中获得了
RelativeLayout

<RelativeLayout xmlns:
    android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:maxWidth="350dp"
    ></RelativeLayout>


android:maxWidth=“350dp”
不工作。对于
layout\u width
wrap\u content
layout\u height
两者都不起作用。

我意识到
maxWidth
参数对于
RelativeLayout
不能也不能起作用。但安卓Studio用户界面并未将其视为
RelativeLayout
的错误参数
Maxwidth
param可用于
视图
ConstraintLayout
,因此在解决方案中,我将使用它将
相对定位
添加到
ConstraintLayout

请共享您想要的相同内容的屏幕截图?您得到了
android:layout\u width=“match\u parent”
这意味着您的布局将尽可能宽possible@A.Shevchuk我把它改成了
wrap_content
,但它是一样的。@Januszj.,你能澄清一下你的预期结果吗?我刚刚检查了RelativeLayout甚至ViewGroupp的文档,它们不是android:maxWidth的属性。它是按视图而不是全部声明的,因此例如,视图EditText和ContrainLayout都具有该属性。