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 –