Set contentMode to UIViewContentModeRedraw
Set contentMode to UIViewContentModeRedraw

As stated in the UIView Class Reference: “Changing the frame rectangle
automatically redisplays the receiver without invoking the drawRect:
method. If you want the drawRect: method invoked when the frame rectangle
changes, set the contentMode property to UIViewContentModeRedraw.”

KBvsMJ/HMSegmentedControl,hons82/HMSegmentedControl,waynett/HMSegmentedControl,lazyelegance/HMSegmentedControl,Akhrameev/HMSegmentedControl,jianwoo/HMSegmentedControl,memorywarning/HMSegmentedControl,yincheng1988/HMSegmentedControl,treejames/HMSegmentedControl,sujeking/HMSegmentedControl,spbreak/HMSegmentedControl,xueqiu/HMSegmentedControl,azureatom/HMSegmentedControl,takeshineshiro/HMSegmentedControl,bytehq/HMSegmentedControl,hbucius/HMSegmentedControl,Sunday4/HMSegmentedControl,arnaudWasappli/HMSegmentedControl,crazytonyli/HMSegmentedControl,datomnurdin/HMSegmentedControl,Discovery-Software/HMSegmentedControl,AlexanderMazaletskiy/HMSegmentedControl,Transparentmask/HMSegmentedControl,andrewchae/HMSegmentedControl,Meeca/HMSegmentedControl,brunojppb/HMSegmentedControl,skrew/HMSegmentedControl,jsooriah/HMSegmentedControl,GinoShen/HMSegmentedControl,fullstackclub/HMSegmentedControl,hoanganh6491/HMSegmentedControl,y-ogi/HMSegmentedControl,shenhzou654321/HMSegmentedControl,mohsinalimat/HMSegmentedControl,xuxueing/HMSegmentedControl,fossugn/HMSegmentedControl