Comments (5)
你的item 外层viewgroup 的高度 应该是wrap_content吧,,不对,listview的item高度其实就是wrap_content
from android-percent-support-extend.
@qq530402037 请问下你是怎么做的,我怎么搞在列表里也显示不出来。如下:
<com.zhy.android.percent.support.PercentLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
app:layout_heightPercent="100%sh"
app:layout_widthPercent="100%sw" >
<TextView
android:layout_width="0dp"
android:layout_height="0dp"
android:background="#00000000"
android:gravity="center_horizontal|bottom"
android:text="星期二"
android:textColor="@color/white"
app:layout_heightPercent="35%sh"
app:layout_textSizePercent="18%sh"
app:layout_widthPercent="100%" />
<ImageView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_gravity="center"
android:src="@drawable/s_overcast_day"
app:layout_heightPercent="30%sh"
app:layout_marginTopPercent="5%"
app:layout_widthPercent="30%" />
<TextView
android:layout_width="0dp"
android:layout_height="0dp"
android:background="#00000000"
android:gravity="center"
android:text="16°-24°"
android:textColor="@color/white"
app:layout_heightPercent="35%sh"
app:layout_textSizePercent="18%sh"
app:layout_widthPercent="100%" />
</com.zhy.android.percent.support.PercentLinearLayout>
from android-percent-support-extend.
<com.zhy.android.percent.support.PercentLinearLayout 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"
android:orientation="vertical">
<TextView
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@android:color/holo_green_light"
android:text="啊啊啊啊啊啊啊啊啊啊"
android:gravity="center"
app:layout_heightPercent="20%h"
app:layout_widthPercent="80%w"
app:layout_textSizePercent="5%w"
/>
<com.zhy.android.percent.support.PercentLinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@android:color/holo_blue_light"
android:text="aaa"
android:gravity="center"
app:layout_heightPercent="20%sh"
app:layout_widthPercent="40%sw"
app:layout_textSizePercent="5%w"
/>
<TextView
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@android:color/holo_blue_light"
android:text="bbbbb"
android:gravity="center"
app:layout_heightPercent="20%sh"
app:layout_widthPercent="40%sw"
app:layout_textSizePercent="5%w"
/>
</com.zhy.android.percent.support.PercentLinearLayout>
</com.zhy.android.percent.support.PercentLinearLayout>
sw sh在预览图里就是不显示的
而且还有个问题,一个item同一行的两个控件,要么都用w,sw,要么都用sh,如果s,sw 和sh混用,就会出现两个控件设定高度一样但实际显示高度不一样的情况
from android-percent-support-extend.
您好,弱弱的问一下: 对于值可以取:10%w , 10%h , 10% , 10%sw , 10%sh
这里的sw 和sh 是什么意思??
from android-percent-support-extend.
@cjcj125125 screen w/h 屏幕宽度高度 ,w/h是基于父View的,sw/sh是基于屏幕的
from android-percent-support-extend.
Related Issues (20)
- 这种情况怎么解决?根本用不了,急! HOT 1
- 代码补全没有我可以用Live Templates, 可是%sw和%sh无法预览这让人很尴尬呀~ 求解决办法!
- android 7.0适配 HOT 3
- PercentLinearLayout使用app:layout_paddingPercent等属性没有效果??
- PercentRelativeLayout里的android:layout_alignBaseline属性失效
- 在ScrollView中无法正常显示?
- compile后编译在模拟器会白屏
- 大神,问一下,这个能用java设置么
- paddingLeftPercent 不生效
- 谷歌的百分比库已废弃,转用约束布局,是不是说以后屏幕适配都可以用约束布局实现了? HOT 4
- Scroll view of edit texts
- 你们用了不会觉得列表很卡吗 HOT 1
- 自定义控件如何修改使用此库
- ConstraintLayout 饥渴难耐 HOT 1
- ConstraintLayout 饥渴难耐 HOT 1
- Caused by: java.util.IllegalFormatConversionException: %f can't format com.zhy.android.percent.support.PercentLayoutHelper$PercentLayoutInfo$PercentVal arguments HOT 2
- 你好不知道这个错误的原因
- error: '100%w' is incompatible with attribute layout_widthPercent (attr) fraction [weak].
- 报错啦!!! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-percent-support-extend.