Android 增强版百分比布局库 为了适配而扩展(1),android音视频面试题

<TextView

android:layout_width=“match_parent”

android:layout_height=“match_parent”

android:layout_gravity=“center”

android:background=“#ff7ecc16”

android:gravity=“center”

android:text=“margin 15% of w”

app:layout_marginPercent=“15%w”

/>

</com.zhy.android.percent.support.PercentFrameLayout>

</com.zhy.android.percent.support.PercentFrameLayout>

<TextView android:layout_width=“0dp”

android:layout_height=“0dp”

android:layout_gravity=“bottom|right”

android:background=“#44ff0000”

android:gravity=“center”

android:text=“15%w,15%w”

app:layout_heightPercent=“15%w”

app:layout_marginPercent=“5%w”

app:layout_widthPercent=“15%w”/>

</com.zhy.android.percent.support.PercentFrameLayout>

Demo 2

xml:

<?xml version="1.0" encoding="utf-8"?>

<com.zhy.android.percent.support.PercentRelativeLayout

xmlns:android=“http://schemas.android.com/apk/res/android”

xmlns:app=“http://schemas.android.com/apk/res-auto”

android:layout_width=“match_parent”

android:layout_height=“match_parent”

android:clickable=“true”>

<TextView

android:id=“@+id/row_one_item_one”

android:layout_width=“0dp”

android:layout_height=“0dp”

android:layout_alignParentTop=“true”

android:background=“#7700ff00”

android:text=“w:70%,h:20%”

android:gravity=“center”

app:layout_heightPercent=“20%”

app:layout_widthPercent=“70%”/>

<TextView

android:id=“@+id/row_one_item_two”

android:layout_width=“0dp”

android:layout_height=“0dp”

android:layout_toRightOf=“@+id/row_one_item_one”

android:background=“#396190”

android:text=“w:30%,h:20%”

app:layout_heightPercent=“20%”

android:gravity=“center”

app:layout_widthPercent=“30%”/>

<ImageView

android:id=“@+id/row_two_item_one”

android:layout_width=“match_parent”

android:layout_height=“0dp”

android:src=“@drawable/tangyan”

android:scaleType=“centerCrop”

android:layout_below=“@+id/row_one_item_one”

android:background=“#d89695”

app:layout_heightPercent=“70%”/>

<TextView

android:layout_width=“0dp”

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值