GithubHelp home page GithubHelp logo

Comments (10)

xmuSistone avatar xmuSistone commented on May 19, 2024

????
无法居中?你是开玩笑的吧......子View对应CardItemView,layout文件是card_item。就是一个普普通通的layout文件,怎么会无法居中呢

from cardslidepanel.

wyb20151010 avatar wyb20151010 commented on May 19, 2024

好像位置移动不了啊,把CardSlidePanel继承RelativeLayout,子view依然没法水平居中啊。。。

from cardslidepanel.

xmuSistone avatar xmuSistone commented on May 19, 2024

CardSlidePanel继承ViewGroup,干嘛继承relativeLayout。框架不是好好的么?干嘛要改呢

from cardslidepanel.

wyb20151010 avatar wyb20151010 commented on May 19, 2024

恩,不改怎么居中呢,layout_gravity="center_horizontal"没用啊。。。

from cardslidepanel.

xmuSistone avatar xmuSistone commented on May 19, 2024

不要改框架的。框架已经很灵活了,能满足你所有的定制需求的。
card_item.xml里面根view的宽度是适配屏幕宽度的。你只需要改card_item.xml即可。其它都无需改动~

from cardslidepanel.

xmuSistone avatar xmuSistone commented on May 19, 2024

layout_gravity="center_horizontal"没用啊。。。
姐姐,你加上这个,本身对RelativeLayout也是无效的~~~

from cardslidepanel.

wyb20151010 avatar wyb20151010 commented on May 19, 2024

还有一个问题下面的层叠左边和右边会不对齐,我已经改好这个bug
int childHeight = viewItem.getMeasuredHeight();
int childWidth = viewItem.getMeasuredWidth();
viewItem.layout(left, top, left + childWidth, top + childHeight);

from cardslidepanel.

wyb20151010 avatar wyb20151010 commented on May 19, 2024

我知道layout_gravity="center_horizontal"对RelativeLayout无效,(⊙﹏⊙)b,问题是card_item.xml中布局居中了,主布局就是不居中。。。

from cardslidepanel.

xmuSistone avatar xmuSistone commented on May 19, 2024

框架不建议改。

一开始设计的时候,我也想着子view有多宽就渲染多宽,但是传入的measuedWidth会引发其它错乱,所以目前cardItemView总是填满屏幕的,你用Hierarchy Viewer看一下就会知道的。

如果card_item.xml布局居中,理论上主布局就应该是居中的。如果没居中,是你改了框架的问题。

from cardslidepanel.

wyb20151010 avatar wyb20151010 commented on May 19, 2024

好吧,谢谢你的回答。。。。

from cardslidepanel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.