Comments (10)
????
无法居中?你是开玩笑的吧......子View对应CardItemView,layout文件是card_item。就是一个普普通通的layout文件,怎么会无法居中呢
from cardslidepanel.
好像位置移动不了啊,把CardSlidePanel继承RelativeLayout,子view依然没法水平居中啊。。。
from cardslidepanel.
CardSlidePanel继承ViewGroup,干嘛继承relativeLayout。框架不是好好的么?干嘛要改呢
from cardslidepanel.
恩,不改怎么居中呢,layout_gravity="center_horizontal"没用啊。。。
from cardslidepanel.
不要改框架的。框架已经很灵活了,能满足你所有的定制需求的。
card_item.xml里面根view的宽度是适配屏幕宽度的。你只需要改card_item.xml即可。其它都无需改动~
from cardslidepanel.
layout_gravity="center_horizontal"没用啊。。。
姐姐,你加上这个,本身对RelativeLayout也是无效的~~~
from cardslidepanel.
还有一个问题下面的层叠左边和右边会不对齐,我已经改好这个bug
int childHeight = viewItem.getMeasuredHeight();
int childWidth = viewItem.getMeasuredWidth();
viewItem.layout(left, top, left + childWidth, top + childHeight);
from cardslidepanel.
我知道layout_gravity="center_horizontal"对RelativeLayout无效,(⊙﹏⊙)b,问题是card_item.xml中布局居中了,主布局就是不居中。。。
from cardslidepanel.
框架不建议改。
一开始设计的时候,我也想着子view有多宽就渲染多宽,但是传入的measuedWidth会引发其它错乱,所以目前cardItemView总是填满屏幕的,你用Hierarchy Viewer看一下就会知道的。
如果card_item.xml布局居中,理论上主布局就应该是居中的。如果没居中,是你改了框架的问题。
from cardslidepanel.
好吧,谢谢你的回答。。。。
from cardslidepanel.
Related Issues (20)
- update viewHolder after Build HOT 2
- Set gravity center HOT 4
- Infinite list HOT 2
- 页面抖动
- 数据加载问题 HOT 2
- 建议 HOT 2
- How to change Data without refresh the order of the cards HOT 2
- How to go next or previous slide programmatically ? HOT 3
- 卡片上图片的点击事件是不是被拦截了 我设置了没有效果 HOT 2
- 放到fragment中显示,view有抖动 HOT 2
- 一个bug
- 优化建议,能否支持一下点击按钮回看上一张 HOT 1
- How can i show 4 cards at a time instead of 3?
- 请问怎么安装你的库啊…… HOT 1
- xxx
- 怎样切换下一张呢
- 怎样根据滑动距离,实现卡片上某个View的alpha从无到有? HOT 2
- 怎样让卡片的底部view不接受手势事件 HOT 2
- Hi
- 如何将底部的层叠效果更改至顶部
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 cardslidepanel.