0

星評価選択コンポーネント ベースの UIAlertController を作成したいと考えています。私の現在のアプローチは

UIAlertController * view=   [UIAlertController
                             alertControllerWithTitle:@""
                             message:@"Minimum Rating"
                             preferredStyle:UIAlertControllerStyleActionSheet];

UIAlertAction* ok = [UIAlertAction
                     actionWithTitle:@""
                     style:UIAlertActionStyleDefault
                     handler:^(UIAlertAction * action)
                     {
                         //Do some thing here
                         [view dismissViewControllerAnimated:YES completion:nil];

                     }];
[ok setValue:[UIImage imageNamed:@"starRating_1"] forKey:@"image"];

UIAlertAction* ok2 = [UIAlertAction
                     actionWithTitle:@""
                     style:UIAlertActionStyleDefault
                     handler:^(UIAlertAction * action)
                     {
                         //Do some thing here
                         [view dismissViewControllerAnimated:YES completion:nil];

                     }];
[ok setValue:[UIImage imageNamed:@"starRating_2"] forKey:@"image"];

UIAlertAction* ok3 = [UIAlertAction
                     actionWithTitle:@""
                     style:UIAlertActionStyleDefault
                     handler:^(UIAlertAction * action)
                     {
                         //Do some thing here
                         [view dismissViewControllerAnimated:YES completion:nil];

                     }];
[ok setValue:[UIImage imageNamed:@"starRating_3"] forKey:@"image"];

[view addAction:ok];
[view addAction:ok2];
[view addAction:ok3];
[self presentViewController:view animated:YES completion:nil];

残念ながら、画像は左側のアクセサリ ビューに表示されます。AlertAction タイトルの代わりに画像を使用する方法はありますか?

4

0 に答える 0