Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
選択した色が青以外の uisegmentcontrol を作成しようとしています。また、下の画像のようにスタイルを変更したいと思います。これらの 2 つのことのいずれかが可能であり、どのように行うのですか?
これを行う最も簡単な方法は、やUISegmentedControlなどのインスタンス メソッドを使用してカスタム イメージを使用することです。setWidth:forSegmentAtIndex:setImage:forSegmentAtIndex:setDividerImage:forLeftSegmentState:rightSegmentState:barMetrics
UISegmentedControl
setWidth:forSegmentAtIndex:
setImage:forSegmentAtIndex:
setDividerImage:forLeftSegmentState:rightSegmentState:barMetrics
UIButtons を使用して、 a の動作を模倣することもできますUISegmentedControl
UIButton