Giter VIP home page Giter VIP logo

mmpopupview's Issues

如果没有title,detailLabel的位置显示的不好

串哥,原因是detailLabel的top.offSet写死了。

[self.detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(lastAttribute).offset(5);//这里应该加一个判断
make.left.right.equalTo(self).insets(UIEdgeInsetsMake(0, config.innerMargin, 0, config.innerMargin));
}];

Pod 内找不到该资源

使用 pod 'MMPopupView' 安装失败。
发现Pod内搜索不到该资源。

MacPro:~$ pod search MMpopupView
[!] Unable to find a pod with name matching `MMpopupView'

Problem

如果看到,请帮忙回复下,谢谢!😄

横屏问题

很好用,不过横屏时方向有问题,期待新版本

self.type = MMPopupTypeCustom 之后的动画效果不是下滑

您好,我自定义了一个 PopupView,type是MMPopupTypeCustom,但是动画效果却不是 demo 里面那样的是下滑的,当我在自定义 view 上面添加一个 textField 之后重载 showKeyBoard 方法之后才会有下滑的动画效果

将AlertView添加到KeyWindow后会产生黑屏问题

我将 MMAlertView 添加至 [UIApplication sharedApplication].keyWindow, 在点击 Item之后, 界面变为黑色.
我如何能够将 MMAlertView 添加至全屏幕 且 顺利执行?

附代码:


 MMPopupItemHandler completeBlock = ^(NSInteger index){
//***
 };

NSArray *items =
  @[
 MMItemMake(@"不了,谢谢", MMItemTypeNormal, nil),
 MMItemMake(@"去注册", MMItemTypeHighlight, completeBlock)];

 MMAlertView *alertView = [[MMAlertView alloc] initWithTitle:@"创建新用户"
                                                                                      detail:@"该手机号未注册, 是否注册为新用户?"
                                                                                      items:items];
 alertView.attachedView = [UIApplication sharedApplication].keyWindow;

 [alertView show];

Appdelegate中如何使用

我这里有个需求,Appdelegate中监听某一事件,当触发后弹出提示框。请问在要如何使用?
alert.attachedView = self.window.rootViewController.view
alert.show()
行不通

xib创建的崩溃信息'

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'hide animation must be there'

通过xib创建一个view,xib中有个按钮,拖线后,点击按钮崩溃
//

  • (instancetype)init
    {
    self = [super init];
    if (self) {

    self.type = MMPopupTypeSheet;
    
    
    self.backgroundColor = [UIColor whiteColor];
    
    [self mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo([UIScreen mainScreen].bounds.size.width);
        make.height.mas_equalTo(400);
    }];
    
    
    [self loadFormXib];
    

    }
    return self;
    }

-(void)loadFormXib{

UIView *xib = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil].lastObject;


xib.frame = self.frame;

[self addSubview:xib];

}

  • (IBAction)backButtonClick:(id)sender {

    [self hide];
    }

串哥给看看呗

你好,请教一个问题

首先,非常感谢你分享的popView框架,用起来非常方便。效果也很好。
其次,有个问题请教一下:当我点击了MMPopView的item之后,然后当前控制器去modal一个控制器,经常会崩溃,但是没有断点。希望有时间查看一下这个问题。我也在查看,有结果会及时通知你,谢谢!

把NSLog去掉,或者改成DEBUG模式使用

这一行
MMPopupCategory.m

- (void)mm_showDimBackground
{
    ++self.mm_dimReferenceCount;

    NSLog(@"dim count: %@",@(self.mm_dimReferenceCount));

    if ( self.mm_dimReferenceCount > 1 )
    {
        return;
    }
}

MMPopupView isn't shown up

Delpoyment Target: iOS 7.0
Base Target: iOS 9.0

Version: 1.5

[[[MMAlertView alloc] initWithConfirmTitle:@"xxxxxx" detail:nil] show];

Never show up

屏幕旋转问题

首先谢谢作者的付出。
情况是这样的:
1.在一个控制器里设置竖屏
2.show出自定义的MMPoppuView
3.旋转屏幕,控制器不受影响,但是状态栏无法控制,仍然随屏幕旋转改变。

这个情况在hide掉之后,仍然存在。

我估计是因为MMPopupWindow的问题,我尝试修改成一个自定义的rootViewController,就可以控制这个情况了。但是效果仍然不太好。

旋转视图时,AlertView的方向不对

竖屏的ViewController,弹出AlertView ,然后 present一个横屏的ViewController出来以后,再弹出一个AlertView,第二个 AlertView的方向不对。

hide 方法失效

自定义view继承MMPopupView,设置按钮点击方法,hide方法失效,有时需要点击几次才能执行

MMAlertView 点击「确定」不消失问题。

 MMAlertView *inputView = [[MMAlertView alloc] initWithInputTitle:@"Title" detail:@"" placeholder:palceHolder handler:^(NSString *text) {
// 想在点击确定的的时候消失。
}];
[inputView show];

串神,我在使用有输入框的 AlertView 时,点击取消时会自动消失,点击确定的时候不消失。想在 block 回调的时候调用消失方法,但是此时实例还没初始化,又不能捕获到自己的实例。

暂时的处理是,直接在源码里面 self.inputHandler() 前调了下 hide ....

不知道有没有什么其他的解决办法?

有swift版本吗?

这个样式真心漂亮, 不知是否考虑出个swift版?
找了好几圈, 一直未找到能这么漂亮的swift版本的替代版本..

请问有Swift版本吗

MMPopupView非常漂亮实用,我现在使用桥接方法可以在swift当中使用,但是请问有swift版本的吗

sheetView swift 下 不能正常使用

首先感谢分享这么好的popView,最近正好在学习使用swift,发现两个小问题
let block: MMPopupItemHandler = { (index) -> Void in
printLog(index)
}
let items = [MMItemMake("男", MMItemType.Normal, block),
MMItemMake("女", .Normal, block),
MMItemMake("取消", .Normal, block)]
let sheet = MMSheetView(title: "选择性别", items: items)
sheet.show()
如上所示,直接报错error: IR generation failure: program too clever: variable collides with existing symbol OBJC_CLASS_$_MMPopupItem

如果按下面这种写法
weak var weakSelf = self
let man = MMItemMake("男", .Normal) { (index) -> Void in
weakSelf?.gender = "男"
}
let girl = MMItemMake("女", .Normal) { (index) -> Void in
weakSelf?.gender = "女"
}
let sheet = MMSheetView(title: "请选择您的性别:", items: [man,girl])
sheet.show()
就可以正常弹出

使用Swift自定义MMPopupView

你好,我在使用您的MMPopupView时遇到这个情况,自定义的View无法显示,一直找不到原因,以下是我的代码 能否麻烦您帮我看一下是不是哪里错了呢,感谢
`import UIKit
import ChameleonFramework
enum ShareType {
case TOPIC
case STATION
}
class ShareView: MMPopupView {
typealias cancelAc = ()
typealias confirmAc = () -> Void
internal var cancelBlock: cancelAc?
private var confirmBlock: confirmAc?
// 标题
private var titleLabel: UILabel = {
let label = UILabel()
label.textColor = FlatNavyBlue()
label.textAlignment = .Center
label.font = UIFont.systemFontOfSize(15)
label.layer.borderWidth = 0.3
label.layer.borderColor = FlatWhite().CGColor
label.backgroundColor = UIColor.vcMainColor()
label.layer.masksToBounds = true
return label
}()
// 确定 按钮
private var confirmBtn: UIButton = {
let confirmBtn = UIButton()
confirmBtn.titleLabel?.font = UIFont.systemFontOfSize(14)
confirmBtn.setTitleColor(FlatNavyBlueDark(), forState: .Normal)
confirmBtn.backgroundColor = UIColor.vcMainColor()
return confirmBtn
}()
// 图片
private var shareImageView: UIImageView = {
let imageView = UIImageView()
imageView.layer.cornerRadius = 5.0
imageView.layer.masksToBounds = true
return imageView
}()
// 正文标题
private var shareTitle: UILabel = {
let label = UILabel()
label.textColor = FlatBlack()
label.font = UIFont.systemFontOfSize(15)
return label
}()
// 正文
private var shareContentLabel: UILabel = {
let label = UILabel()
label.font = UIFont.systemFontOfSize(12)
label.textColor = FlatGray()
label.backgroundColor = UIColor.vcMainColor()
label.layer.cornerRadius = 1.0
label.layer.masksToBounds = true
return label
}()
// 标题 Title
internal var mainTitle: String? = "提示"{
didSet{
titleLabel.text = mainTitle
}
}
// ShareView背景色
internal var viewColor: UIColor? = UIColor.whiteColor(){
didSet{
self.backgroundColor = viewColor
}
}
// 确定按钮 Title
internal var confirmTitle: String? = "确定"{
didSet{
confirmBtn.setTitle(confirmTitle, forState: .Normal)
}
}
// 确定按钮 TitleColor
internal var confirmBtnTitleColor: UIColor? = FlatNavyBlueDark(){
didSet{
confirmBtn.setTitleColor(confirmBtnTitleColor, forState: .Normal)
}
}
override init(frame: CGRect) {
super.init(frame: frame)
}
// 取消按钮-事件
func cancel(){

}
// 确定按钮-事件
func confirm(){
    self.hide()
    confirmBlock!()
}
init(Type:ShareType,frame:CGRect,shareData:ShareData,confirmAction: (() -> Void)?) {
    super.init(frame: frame)
    print("MMPopup初始化\(frame)")
    self.type = MMPopupType.Custom
    self.frame = frame
    self.backgroundColor = viewColor
    self.layer.cornerRadius = 2.0
    self.layer.masksToBounds = true
    titleLabel.text = mainTitle

    confirmBlock = confirmAction
    confirmBtn.setTitle(confirmTitle, forState: .Normal)
    confirmBtn.addTarget(self, action: #selector(self.confirm), forControlEvents: .TouchUpInside)
    self.addSubview(titleLabel)
    //self.addSubview(cancelBtn)
    self.addSubview(confirmBtn)
    titleLabel.sd_layout()
        .topSpaceToView(self,0)
        .leftSpaceToView(self,0)
        .rightSpaceToView(self,0)
        .heightIs(30)
    confirmBtn.sd_layout()
        .leftSpaceToView(self,0)
        .rightSpaceToView(self,0)
        .bottomSpaceToView(self,0)
        .heightIs(35)
    switch Type {
    case .STATION:
        StationShareViewInitlizel(shareData)
        break
    case .TOPIC:
        TopicShareViewInitlizel(shareData)
        break
    }
}
required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
}
private func StationShareViewInitlizel(data:ShareData){
    shareImageView.sd_setImageWithURL(NSURL(string: data.shareImageUrlStr))
    self.addSubview(shareImageView)
    shareImageView.sd_layout()
        .topSpaceToView(titleLabel,5)
        .leftSpaceToView(self,5)
        .heightIs(self.frame.height - 35 - 30 - 15)
        .widthIs(self.frame.height - 35 - 30 - 15)
    shareTitle.text = data.shareTitle
    self.addSubview(shareTitle)
    shareTitle.sd_layout()
        .topEqualToView(shareImageView)
        .leftSpaceToView(shareImageView,5)
        .rightSpaceToView(self,5)
        .heightIs(16)
    shareContentLabel.text = data.shareContent
    self.addSubview(shareContentLabel)
    shareContentLabel.sd_layout()
        .topSpaceToView(shareTitle,10)
        .leftEqualToView(shareTitle)
        .rightEqualToView(shareTitle)
        .autoHeightRatio(0)
    shareContentLabel.setMaxNumberOfLinesToShow(3)
}
private func TopicShareViewInitlizel(data:ShareData){

}`

第一次调用show不显示

我用Swift模仿MMDateView写了个PopupView,但是第一次show不出来,只看到虚化的背景,点击自动hide之后,再调用show就出来了..不知道是什么情况..对象是每次都new的,就是每次都执行的相同的代码
btw..感谢你开源的这个项目,我很钟意.

set attachedView to keyWindow causing black screen

MMAlertView *alertView = [[MMAlertView alloc] initWithTitle:kATitle detail:kATip items:items];
alertView.attachedView = [UIApplication sharedApplication].keyWindow;

alertView can show normally, but it turns black screen after click every item.

environment: Xcode7.3

恭喜

哥,你写的库又上榜了,恭喜啊。

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.