android-percent-library

Missing XML resource type for PercentRelativeLayout Percentage value?

放肆的年华 提交于 2019-12-21 07:05:30
问题 It seems that the new Percent Support Library was released without allowing to reference a Percentage value in a dimension xml file. That is, instead of : <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 app:layout_widthPercent="50%" app:layout_heightPercent="50%" app:layout_marginTopPercent="25%" app

Replacement for the linearLayout weights mechanism

蹲街弑〆低调 提交于 2019-12-20 09:54:24
问题 Background: Google suggests to avoid using nested weighted linearLayouts because of performance. using nested weighted linearLayout is awful to read, write and maintain. there is still no good alternative for putting views that are % of the available size. Only solutions are weights and using OpenGL. There isn't even something like the "viewBox" shown on WPF/Silverlight to auto-scale things. This is why I've decided to create my own layout which you tell for each of its children exactly what

PercentFrameLayout: You must supply a layout_width attribute

北慕城南 提交于 2019-12-12 10:49:20
问题 I try to use a PercentFrameLayout but I get this error message: Binary XML file line #: You must supply a layout_width attribute. This is the xml I use: <android.support.percent.PercentFrameLayout 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 app:layout_heightPercent="50%" app:layout_marginLeftPercent="25%" app:layout_marginTopPercent="25%" app

Missing XML resource type for PercentRelativeLayout Percentage value?

对着背影说爱祢 提交于 2019-12-04 01:01:16
It seems that the new Percent Support Library was released without allowing to reference a Percentage value in a dimension xml file. That is, instead of : <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 app:layout_widthPercent="50%" app:layout_heightPercent="50%" app:layout_marginTopPercent="25%" app:layout_marginLeftPercent="25%"/> </android.support.percent.PercentFrameLayout/> being able to code

PercentRelativeLayout, how to set the height programmatically

萝らか妹 提交于 2019-11-30 02:55:00
I am using PercentRelativeLayout from android percent support package. this is what I have in my layout. <android.support.percent.PercentRelativeLayout android:id="@+id/view_parent" app:layout_heightPercent="68%" android:visibility="invisible" android:layout_width="match_parent" android:background="@color/mountain_meadow" android:layout_alignParentTop="true" android:layout_height="wrap_content"> <View android:id="@+id/view_child" android:layout_width="match_parent" app:layout_heightPercent="30%" android:layout_alignParentBottom="true" /> </android.support.percent.PercentRelativeLayout> I want

PercentRelativeLayout, how to set the height programmatically

元气小坏坏 提交于 2019-11-28 23:50:17
问题 I am using PercentRelativeLayout from android percent support package. this is what I have in my layout. <android.support.percent.PercentRelativeLayout android:id="@+id/view_parent" app:layout_heightPercent="68%" android:visibility="invisible" android:layout_width="match_parent" android:background="@color/mountain_meadow" android:layout_alignParentTop="true" android:layout_height="wrap_content"> <View android:id="@+id/view_child" android:layout_width="match_parent" app:layout_heightPercent=