Coder Social home page Coder Social logo

Comments (12)

liufengting avatar liufengting commented on May 18, 2024

我开个分支

from ftpopovermenu.

liufengting avatar liufengting commented on May 18, 2024

想了一下,好像架构完全不一样了,这个需求是否完全必要,或者截至时限有多久?我在考虑重新写。

from ftpopovermenu.

Haley-Wong avatar Haley-Wong commented on May 18, 2024

我本来也想改你源码来着,看了一下目前里面的架构只能支撑单个弹窗,没法改,就先用单弹窗做了考虑以后撸,不急。
另外,我发现如果弹窗箭头是朝下的话,背景是类似白色的浅色,最后一个分割线很碍眼。如下图:
f1ce771e-bf4d-4964-b082-4dd836348ced

然后我考虑在判断到方向后,tableView上添加一个视图覆盖掉最后那个分割线,代码如下(196行):

if (_arrowDirection == FTPopOverMenuArrowDirectionDown) {
        menuRect = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height - FTDefaultMenuArrowHeight);
        // 遮住最后的白线 by Haley 2016-11-17
        UIView *lineView = [self viewWithTag:201];
        if (!lineView) {
            lineView = [[UIView alloc] initWithFrame:CGRectZero];
        }
        lineView.frame = CGRectMake(5, menuRect.size.height-2, menuRect.size.width - 10, 2);
        lineView.tag = 201;
        lineView.backgroundColor = [FTPopOverMenuConfiguration defaultConfiguration].tintColor;
        [self insertSubview:lineView aboveSubview:self.menuTableView];
    }
    [self.menuTableView setFrame:menuRect];
    [self.menuTableView reloadData];

其实就算是朝上的,也可以遮住最后的分割线。关于遮盖分割线的视图宽高位置,以及用tag还是属性view,还有必要性,你考虑一下。最后的效果是这样的:
141f8e95-5951-4b45-a421-07f97ccdf854

from ftpopovermenu.

Haley-Wong avatar Haley-Wong commented on May 18, 2024

我这边是要实现微信公众号底部菜单的效果。

from ftpopovermenu.

liufengting avatar liufengting commented on May 18, 2024

试试这几行代码:

if (indexPath.row == _menuStringArray.count-1) {
menuCell.separatorInset = UIEdgeInsetsMake(0, self.bounds.size.width, 0, 0);
}else{
menuCell.separatorInset = UIEdgeInsetsMake(0, FTDefaultMenuTextMargin, 0, FTDefaultMenuTextMargin);
}

from ftpopovermenu.

liufengting avatar liufengting commented on May 18, 2024

这个更改已经发布了1.2.3版本

from ftpopovermenu.

Haley-Wong avatar Haley-Wong commented on May 18, 2024

你这个处理效果更优!

from ftpopovermenu.

Haley-Wong avatar Haley-Wong commented on May 18, 2024

分割线左边距并不是设置的宏的值6,不知道你这边有更优雅的做法么?我是把后面改成了10+宏值。

from ftpopovermenu.

liufengting avatar liufengting commented on May 18, 2024

后来提交的代码里面其实是可以随意设置的,可能170行左右这行代码需要注释掉:

    _menuTableView.separatorInset = UIEdgeInsetsMake(0, FTDefaultMenuTextMargin, 0, FTDefaultMenuTextMargin);

111
1111

from ftpopovermenu.

Haley-Wong avatar Haley-Wong commented on May 18, 2024

@liufengting 测试了10月14号我下载的版本,和刚下的版本,得出的结果是在iOS 10以上分割线正常,在iOS 10以下(测了iOS 9),分割线前面有固定15的距离。

from ftpopovermenu.

liufengting avatar liufengting commented on May 18, 2024

那应该是系统的限制吧,这个不太好解决,我去查查看吧。

from ftpopovermenu.

liufengting avatar liufengting commented on May 18, 2024

刚才看到一个帖子希望有些帮助,我还没有测试过,你也试试看吧希望能解决iOS9上的这个问题。

http://stackoverflow.com/questions/31537196/ios-9-uitableview-separators-insets-significant-left-margin

from ftpopovermenu.

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.