美文网首页
UISegmentedControl 内容自适应宽度

UISegmentedControl 内容自适应宽度

作者: 5089dee7e81c | 来源:发表于2019-07-10 16:39 被阅读0次

         //   [self.segment setTitle:@"hahahaha" forSegmentAtIndex:0];

只需要在初始化之后或者修改某个title之后调用下面2个方法就会内容自适应宽度

            [self.segment setApportionsSegmentWidthsByContent:YES];

            [self.segment sizeToFit];

相关文章

网友评论

      本文标题:UISegmentedControl 内容自适应宽度

      本文链接:https://www.haomeiwen.com/subject/itghkctx.html