void Initialize() { BubbleHighlightedImage = highlightedBubbleImage; BubbleImage = normalBubbleImage; ContentView.AddConstraints(NSLayoutConstraint.FromVisualFormat("H:|[bubble]", (NSLayoutFormatOptions)0, "bubble", BubbleImageView)); ContentView.AddConstraints(NSLayoutConstraint.FromVisualFormat("V:|-2-[bubble]-2-|", (NSLayoutFormatOptions)0, "bubble", BubbleImageView )); BubbleImageView.AddConstraints(NSLayoutConstraint.FromVisualFormat("H:[bubble(>=48)]", (NSLayoutFormatOptions)0, "bubble", BubbleImageView )); var vSpaceTop = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.Top, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.Top, 1, 10); ContentView.AddConstraint(vSpaceTop); var vSpaceBottom = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.Bottom, 1, -10); ContentView.AddConstraint(vSpaceBottom); var msgLeading = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.Leading, NSLayoutRelation.GreaterThanOrEqual, BubbleImageView, NSLayoutAttribute.Leading, 1, 16); ContentView.AddConstraint(msgLeading); var msgCenter = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.CenterX, 1, 3); ContentView.AddConstraint(msgCenter); }
void Initialize() { BubbleHighlightedImage = highlightedBubbleImage; BubbleImage = normalBubbleImage; ContentView.AddConstraints(NSLayoutConstraint.FromVisualFormat("H:[bubble]|", 0, "bubble", BubbleImageView)); ContentView.AddConstraints(NSLayoutConstraint.FromVisualFormat("V:|-2-[bubble]-2-|", 0, "bubble", BubbleImageView )); BubbleImageView.AddConstraints(NSLayoutConstraint.FromVisualFormat("H:[bubble(>=48)]", 0, "bubble", BubbleImageView )); var vSpaceTop = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.Top, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.Top, 1, 10); ContentView.AddConstraint(vSpaceTop); var vSpaceBottom = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.Bottom, 1, -10); ContentView.AddConstraint(vSpaceBottom); var msgTrailing = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.Trailing, NSLayoutRelation.LessThanOrEqual, BubbleImageView, NSLayoutAttribute.Trailing, 1, -16); ContentView.AddConstraint(msgTrailing); var msgCenter = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.CenterX, 1, -3); ContentView.AddConstraint(msgCenter); MessageLabel.TextColor = UIColor.White; }
void Initialize() { BubbleHighlightedImage = highlightedBubbleImage; BubbleImage = normalBubbleImage; var views = new NSMutableDictionary(); views.Add(new NSString("bubble"), BubbleImageView); views.Add(new NSString("date"), DateLabel); ContentView.AddConstraints(NSLayoutConstraint.FromVisualFormat("H:[bubble]|", 0, "bubble", BubbleImageView)); ContentView.AddConstraints(NSLayoutConstraint.FromVisualFormat("V:|-2-[bubble]-[date]-2-|", 0, null, views)); BubbleImageView.AddConstraints(NSLayoutConstraint.FromVisualFormat("H:[bubble(>=48)]", 0, "bubble", BubbleImageView)); var vSpaceTop = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.Top, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.Top, 1, 10); ContentView.AddConstraint(vSpaceTop); var vSpaceBottom = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.Bottom, 1, -10); ContentView.AddConstraint(vSpaceBottom); var msgTrailing = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.Trailing, NSLayoutRelation.LessThanOrEqual, BubbleImageView, NSLayoutAttribute.Trailing, 1, -16); ContentView.AddConstraint(msgTrailing); var msgCenter = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.CenterX, 1, -3); ContentView.AddConstraint(msgCenter); var vSpaceTopDate = NSLayoutConstraint.Create(DateLabel, NSLayoutAttribute.Top, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.Bottom, 1, 3); ContentView.AddConstraint(vSpaceTopDate); var dateLeading = NSLayoutConstraint.Create(DateLabel, NSLayoutAttribute.Leading, NSLayoutRelation.GreaterThanOrEqual, BubbleImageView, NSLayoutAttribute.Leading, 1, 16); ContentView.AddConstraint(dateLeading); var dateCenter = NSLayoutConstraint.Create(DateLabel, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.CenterX, 1, 3); ContentView.AddConstraint(dateCenter); MessageLabel.TextColor = UIColor.White; }
void Initialize() { BubbleHighlightedImage = highlightedBubbleImage; BubbleImage = normalBubbleImage; ContentView.AddConstraints(NSLayoutConstraint.FromVisualFormat("H:|[bubble]", 0, "bubble", BubbleImageView)); ContentView.AddConstraints(NSLayoutConstraint.FromVisualFormat("V:|-2-[bubble]-2-|", 0, "bubble", BubbleImageView )); BubbleImageView.AddConstraints(NSLayoutConstraint.FromVisualFormat("H:[bubble(>=48)]", 0, "bubble", BubbleImageView )); var vSpaceTop = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.Top, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.Top, 1, 10); ContentView.AddConstraint(vSpaceTop); var vSpaceBottom = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.Bottom, 1, -10); ContentView.AddConstraint(vSpaceBottom); var msgLeading = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.Leading, NSLayoutRelation.GreaterThanOrEqual, BubbleImageView, NSLayoutAttribute.Leading, 1, 16); ContentView.AddConstraint(msgLeading); var msgCenter = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.CenterX, 1, 3); ContentView.AddConstraint(msgCenter); Hediye.Hidden = true; ContentView.BackgroundColor = UIColor.Clear; //MessageLabel.Layer.CornerRadius = 25; //MessageLabel.Layer.BorderWidth = 10f; //MessageLabel.ClipsToBounds = true; //MessageLabel.Layer.BorderColor = UIColor.FromRGB(229, 229, 234).CGColor; //MessageLabel.BackgroundColor = UIColor.FromRGB(229, 229, 234); //MessageLabel.Insent = UIEdgeInsetsMake(10, 0, 10, 0); }
void Initialize() { BubbleHighlightedImage = highlightedBubbleImage; BubbleImage = normalBubbleImage; ContentView.AddConstraints(NSLayoutConstraint.FromVisualFormat("H:[bubble]|", 0, "bubble", BubbleImageView)); ContentView.AddConstraints(NSLayoutConstraint.FromVisualFormat("V:|-2-[bubble]-2-|", 0, "bubble", BubbleImageView )); BubbleImageView.AddConstraints(NSLayoutConstraint.FromVisualFormat("H:[bubble(>=48)]", 0, "bubble", BubbleImageView )); var vSpaceTop = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.Top, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.Top, 1, 10); ContentView.AddConstraint(vSpaceTop); var vSpaceBottom = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.Bottom, 1, -10); ContentView.AddConstraint(vSpaceBottom); var msgTrailing = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.Trailing, NSLayoutRelation.LessThanOrEqual, BubbleImageView, NSLayoutAttribute.Trailing, 1, -16); ContentView.AddConstraint(msgTrailing); var msgCenter = NSLayoutConstraint.Create(MessageLabel, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.CenterX, 1, -3); ContentView.AddConstraint(msgCenter); //var vSpaceBottom0 = NSLayoutConstraint.Create(AudioDownloadButton, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.Bottom, 1, -10); //ContentView.AddConstraint(vSpaceBottom0); //var msgCenter0 = NSLayoutConstraint.Create(AudioDownloadButton, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.CenterX, 1, -10); //ContentView.AddConstraint(msgCenter0); var vSpaceBottom1 = NSLayoutConstraint.Create(AudioPlayButton, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.Bottom, 1, -10); ContentView.AddConstraint(vSpaceBottom1); var msgCenter1 = NSLayoutConstraint.Create(AudioPlayButton, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.CenterX, 1, -3); // ContentView.AddConstraint(msgCenter1); //var vSpaceBottom2 = NSLayoutConstraint.Create(AudioStopButton, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.Bottom, 1, -10); //ContentView.AddConstraint(vSpaceBottom2); //var msgCenter2 = NSLayoutConstraint.Create(AudioStopButton, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.CenterX, 1, -80); //ContentView.AddConstraint(msgCenter2); var vSpaceBottomi = NSLayoutConstraint.Create(ImageAttachment, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.Bottom, 1, -10); ContentView.AddConstraint(vSpaceBottomi); var msgCenteri = NSLayoutConstraint.Create(ImageAttachment, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, BubbleImageView, NSLayoutAttribute.CenterX, 1, -3); ContentView.AddConstraint(msgCenteri); MessageLabel.TextColor = UIColor.White; }