Comments (4)
`
-(void)setFreeRect:(CGRect)freeRect
{
_freeRect = freeRect;
[self keepBounds];
}
`
我的意思大概就是这样,卤煮你看如何。
from wmdragview.
freeRect 相关的还有一个问题
-(void)layoutSubviews{
[super layoutSubviews];
if (self.freeRect.origin.x!=0||self.freeRect.origin.y!=0||self.freeRect.size.height!=0||self.freeRect.size.width!=0) {
//设置了freeRect--活动范围
}else{
//没有设置freeRect--活动范围,则设置默认的活动范围为父视图的frame
self.freeRect = (CGRect){CGPointZero,self.superview.bounds.size};
}
...
}
如果一开始 freeRect 没设值,这里会把它变成 superview 的区域,但是如果 superview 的大小在之后发生变化,freeRect 就不会修正成新的值了
from wmdragview.
freeRect 相关的还有一个问题
-(void)layoutSubviews{ [super layoutSubviews]; if (self.freeRect.origin.x!=0||self.freeRect.origin.y!=0||self.freeRect.size.height!=0||self.freeRect.size.width!=0) { //设置了freeRect--活动范围 }else{ //没有设置freeRect--活动范围,则设置默认的活动范围为父视图的frame self.freeRect = (CGRect){CGPointZero,self.superview.bounds.size}; } ... }
如果一开始 freeRect 没设值,这里会把它变成 superview 的区域,但是如果 superview 的大小在之后发生变化,freeRect 就不会修正成新的值了
@zhengwenming 确实会存在这个问题
from wmdragview.
已经解决。请更新最新的代码。
from wmdragview.
Related Issues (17)
- 请问下demo里面的视频播放器用的是什么框架? HOT 1
- 问题:设置WMDragView按钮图片后,透明度自动变浅,图片像是加了层膜 HOT 1
- 问题:子控件WMDragView拖出父控件UIView后,还原过程中位置偏移问题 HOT 2
- can you upload a sample using the player?
- 如果多个拖动按钮如何处理? HOT 2
- 什么时候支持CocoaPods HOT 3
- 错别字 HOT 1
- 提一点小问题 HOT 1
- swift 如何使用 HOT 2
- 自带的contentViewForDrag遮挡了自定义view上的按钮响应事件 HOT 2
- 如何实现全局浮窗,切换页面不消失。 HOT 6
- 有一点小bug HOT 1
- 用CGAffineTransformMakeRotation旋转横屏后,平移的问题,可以加这段代码
- 怎么实现像微信视频聊天悬浮的功能 HOT 1
- 拖动效果问题 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 wmdragview.