2
使用Android百分比支持库,如何将ImageView的宽度设置为其包含PercentRelativeLayout的百分比,同时以保持原始高宽比的方式缩放高度?如何使用百分比支持库和保持宽高比设置ImageView宽度?
使用Android百分比支持库,如何将ImageView的宽度设置为其包含PercentRelativeLayout的百分比,同时以保持原始高宽比的方式缩放高度?如何使用百分比支持库和保持宽高比设置ImageView宽度?
我得到这个与版本23.0.0支持的lib工作:
<?xml version="1.0" encoding="utf-8"?>
<android.support.percent.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">
<ImageView
android:src="@drawable/logo"
app:layout_widthPercent="50%"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />
</android.support.percent.PercentRelativeLayout>
啊,我的错误是使用'背景=',而不是'SRC ='。谢谢。 –
你能在这里回答我的问题吗? http://stackoverflow.com/questions/34112295/android-scrollview-and-android-support-percent-percentrelativelayout –