Comments (10)
@senRsl
对于你描述的场景我不是很认同。
但是右滑的功能看来倒是的确有需求,我看看什么时候有时间试一下加这个功能吧。
from slideback.
我按照 slideBackIconView 代码改写了一份可以放在右侧的view(rightSlideBackIconView),但是卡在 container.addView(rightSlideBackIconView); 这个view 无法紧贴右侧屏幕,一直在左侧。请问下能则呢么解决?
from slideback.
@wizos
可以将view放在右侧,目前库里还没有相关实现。虽然没明白需求(ViewPager左右滑),有时间我看看怎么加上比较合适吧。
您的实现方式思路上应该没问题。至于问题,container是一个FrameLayout,addView是默认在左上角的(x=0,y=0)。如果要放在右边,需要加margin去定位(margin_left=screenWidth-viewWidth)。
PS:个人感性上不喜欢margin属性(开发人员选项-显示布局边界,margin属性是红色的,看着很刺眼),所以我不是很推荐使用margin。但目前也想不到更好的方案,如果您需要此功能,可以试一下。
from slideback.
请问怎么加 margin 呢?我使用以下代码,但是不生效。
`
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams( FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT);
lp.setMargins(screenWidth-viewWidth,0,0,0);
rightSlideBackView.setLayoutParams(lp);
container.addView(rightSlideBackView,lp);`
from slideback.
参考此方法
from slideback.
还是不行……
`
container.addView(rightSlideBackView);
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(rightSlideBackView.getLayoutParams());
layoutParams.leftMargin = (int)(screenWidth - maxSlideLength);
rightSlideBackView.setLayoutParams(layoutParams);`
from slideback.
最近沉迷塞尔达难以自拔。。
不急的话,我周末抽时间看看吧。
from slideback.
哈哈,前段时间我也沉迷这个。先谢谢了。
from slideback.
@senRsl
在我看来,普通app、不是浏览器app,完全不需要这个功能(我也没有发现这种app),我也想不到什么应用场景(网页上右滑前进,前进哪个URL?)。
如果你有什么不同见解,请在这里回复告诉我。
from slideback.
@senRsl @wizos
已支持设置屏幕左右侧侧滑,请更新 1.0.5
from slideback.
Related Issues (13)
- 某些情况无法侧滑返回 HOT 3
- Fragment支持? HOT 2
- demo体验 HOT 2
- 1.0.3问题的属性 HOT 2
- 右侧的侧滑无法生效 HOT 1
- 该升级升级了 HOT 1
- 快速滑动时SlideBackIconView没有到最大状态的问题 HOT 3
- Fragment没有起作用 HOT 1
- 横屏侧滑侧边没有动画效果 HOT 5
- 可以仿微信的侧滑返回吗 HOT 4
- 纯Java项目调用问题 HOT 2
- 多次切换页面时alpha会出错 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 slideback.