UIButton のサブビューとして customBadge を追加しようとしています -
これはこれまでの私のコードです-
//msg count initiaition
//CustomBadge *customBadge1 = [CustomBadge customBadgeWithString:@"2"];
CustomBadge *customBadge1 = [CustomBadge customBadgeWithString:@"2"
withStringColor:[UIColor whiteColor]
withInsetColor:[UIColor redColor]
withBadgeFrame:YES
withBadgeFrameColor:[UIColor redColor]
withScale:2.0
withShining:YES];
// Set Position of Badge 1
[customBadge1 setFrame:CGRectMake(self.view.frame.size.width/2-customBadge1.frame.size.width/2+_MsgHeadBtn.frame.size.width/2, 110, customBadge1.frame.size.width, customBadge1.frame.size.height)];
//add badge to view
[_MsgHeadBtn addSubview:customBadge1];
サブビューを追加しようとしているボタンは _MsgHeadBtn です。これは、下のスクリーンショットの上部 LH にある電子メール アイコンです。カスタムバッジをメールアイコンの少し上と右に表示しようとしていましたが、結果はスクリーンショットになりました!
どこが間違っているのか、誰かアドバイスをいただけますか!?