Comments (8)
Check https://github.com/mmin18/FlexLayout/tree/dev (upgrade to v1.2.3)
from flexlayout.
Could you use android:minWidth, android:maxWidth?
from flexlayout.
I can, but they are far less powerful :(
For example, I have a single line TextView, it need a drawable at its right, the TextView's width should be wrap_content (to let the drawable stay together with text), but should have a max width. I hope I can set its max width according to parent width, to let it expand as wide as possible.
I have to set max width in Java code.
from flexlayout.
I see. There is two ways to express: app:layout_width="max(wrap_content, 100%-this.left-icon.left)" or I can add 4 new params app:layout_minWidth ...
The first one is more universal and flexible, and the second one is more easy to understand. Which one do you prefer?
from flexlayout.
Great! First one is awesome enough, it shows the power of FlexLayout again!
A little suggestion, that usage could be added into documentation :)
from flexlayout.
But it seems FlexLayout doesn't support wrap_content
inside max
function? I use 1.2.2
, the IDE preview gives an error:
java.lang.IllegalArgumentException: unknown token wrap_content, layout_width=max(wrap_content, 100% - this.left - icon.left)
Is it just a IDE preview bug?
from flexlayout.
No I haven't implemented it yet.
from flexlayout.
Got it.
from flexlayout.
Related Issues (14)
- MD里padding和margin最好是8的倍数 HOT 2
- Fail to preview in Android Studio 2.2 preview 3 HOT 1
- 关于TextViiew设置layout_top和layout_bottom后内容居中问题 HOT 2
- 动态布局并且定位在前后布局中间时不显示的BUG HOT 3
- TextView宽度测量不对的问题 HOT 2
- Anko feature
- Flexlayout隐藏子控件之后,子控件仍然占用空间 HOT 4
- Docs: Clarify prev/next Meaning HOT 2
- FlexLayout 性能测试 HOT 2
- Setting views relative to another view HOT 10
- Always true conditions HOT 2
- `app:layout_width="min(wrap_content, 100% - 55dp)"` text clipped HOT 2
- @dimen 相关计算无法使用 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 flexlayout.