android-percentrelativelayout

Android - ScrollView and PercentRelativeLayout

拜拜、爱过 提交于 2020-02-04 15:17:26
问题 I have a problem with combining the android.support.percent.PercentRelativeLayout with ScrollView. The following xml file <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/ScrollView01" android:layout_width="fill_parent" android:layout_height="fill_parent" android:fillViewport="true" android:scrollbars="none"> <android.support.percent.PercentRelativeLayout xmlns:android="http://schemas.android.com/apk

How to use PercenRelativeLayout for listView item

回眸只為那壹抹淺笑 提交于 2019-12-23 12:53:34
问题 I'm trying to use PercenRelativeLayout into ListView, but it doesnot works, height and width percents are ignored and nothing were showing into the listview. it works only for marshmallows . here is list item xml <?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:orientation="vertical" android:layout_width="match_parent" android:layout

How to use layout_aspectRatio in the PercentRelativeLayout?

偶尔善良 提交于 2019-12-06 18:33:33
问题 I try to achieve a 16:9 aspect ratio on a view with the PercentRelativeLayout. So I have put this line in my build.gradle file: compile 'com.android.support:design:23.0.1' I use this layout: <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="wrap_content"> <ImageView android:layout_width="match_parent" app:layout_aspectRatio="178

How to use layout_aspectRatio in the PercentRelativeLayout?

送分小仙女□ 提交于 2019-12-04 23:55:09
I try to achieve a 16:9 aspect ratio on a view with the PercentRelativeLayout . So I have put this line in my build.gradle file: compile 'com.android.support:design:23.0.1' I use this layout: <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="wrap_content"> <ImageView android:layout_width="match_parent" app:layout_aspectRatio="178%" android:scaleType="centerCrop"/> </android.support.percent.PercentRelativeLayout> Problems: Android

PercentRelativeLayout is more Performant?

允我心安 提交于 2019-12-03 22:34:13
I always use LinearLayout and RelativeLayouts, and i was reading about the "new" PercentRelativeLayout . I have a few questions: Should i always start using this one or only in cases of nested weights with linearlayout? Is this more performant than the others? Any other information about PercentRelativeLayout it will be welcome. Thanks! Jeroen Mols Looking at the source code , a PercentRelativeLayout is basically a minor extension of a RelativeLayout. This means you need to make the same considerations as when you choose between a RelativeLayout and LinearLayout. RelativeLayout needs 2 measure

PercentRelativeLayout inside ScrollView

会有一股神秘感。 提交于 2019-11-30 01:06:08
问题 I have created a layout using a ScrollView which has a PercentRelativeLayout as its child. It doesn't work on Lollipop and older devices but works fine on Marshmallow devices. Please check the code below: <ScrollView android:id="@+id/scrollView" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true"> <android.support.percent.PercentRelativeLayout android:id="@+id/scrollContent" android:layout_width="wrap_content" android:layout_height="wrap