Skip to content

a top title view, according to the title of a number of automatic adaptation content(UIScrollView、网易新闻、搜狐新闻、腾讯视频顶部滚动菜单)

License

Notifications You must be signed in to change notification settings

HNKF/SGTopTitleView

Repository files navigation

a top title view, according to the title of a number of automatic adaptation content

顶部滚动视图(APP中常见顶部滚动视图,使用UIScrollView进行封装,使用起来极其简单、实用、方便)

* 静止状态下标题按钮的创建

* 滚动状态下标题按钮的创建

* 导航栏上标题按钮的创建

  • SGTopTitleView使用方法一:

    • 将项目中SGTopTitleView文件夹拖入工程

    • 导入#import "SGTopTitleView.h"头文件

    • 通过alloc、initWithFrame或者类方法topTitleViewWithFrame去创建

    • 遵循SGTopTitleViewDelegate协议的delegate_SG方法

    - (void)SGTopTitleView:(SGTopTitleView *)topTitleView didSelectTitleAtIndex:(NSInteger)index;
  • SGTopTitleView使用方法二:(详细使用方法,请参考Demo)

  • 父子控制器的使用

  • navigationItem的titleView的屏幕尺寸处理

  • 通过Label创建标题并在其上添加手势(UITapGestureRecognizer)

  • 根据标题内容:实现标题宽度自适应

- (CGRect)boundingRectWithSize:(CGSize)size options:(NSStringDrawingOptions)options attributes:(nullable NSDictionary *)attributes context:(nullable NSStringDrawingContext *)context;

About

a top title view, according to the title of a number of automatic adaptation content(UIScrollView、网易新闻、搜狐新闻、腾讯视频顶部滚动菜单)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published