这里我正在开发一个聊天演示应用程序。在我的情况是如何设置75%的屏幕布局?请找到附件图片Click here。 如何将绿色聊天区减少到75%? 在这里我使用recyclerview。 这是我的xml文件。如何将布局大小减少到屏幕的75%?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bgc1"
android:padding="5dp"
>
<TextView
android:id="@+id/textMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text Message"
android:layout_alignParentRight="true"
android:textColor="#FFF"
/>
</RelativeLayout>
</RelativeLayout>
只需使用重量和重力。 – zgc7009
你能解释一下我的编码吗? –
你可以将你想要的视图命名为75%吗?从你的xml中不清楚你正在谈论哪个视图。 –