UISegmentedControl设置文字的点击颜色和不点击事的颜色

NSDictionary* selectedTextAttributes =@{NSFontAttributeName:[UIFontsystemFontOfSize:14],NSForegroundColorAttributeName:color(4,111, 209)};

    [self.segsetTitleTextAttributes:selectedTextAttributesforState:UIControlStateSelected];//设置文字属性

    NSDictionary* unselectedTextAttributes =@{NSFontAttributeName:[UIFontsystemFontOfSize:14],NSForegroundColorAttributeName:color(58,57, 57)};

    [self.segsetTitleTextAttributes:unselectedTextAttributesforState:UIControlStateNormal];

你可能感兴趣的:(iOS)