2

I'm trying to lay out a view in WatchKit with an image and a label side by side.

I create a Group with a Horizontal orientation, and add the Image with left justification and a label with right justification.

I actually get two different problems here:

(1) My image is square, but the edge of the image that is against the edge of the group gets rounded off. So I have two rounded corners and two square corners, which looks bad. I'd prefer to get 4 rounded corners -- but mainly I just need it to be consistent.

(2) My label text is long and needs to be wrapped. In the Interface Builder I set lines to 2, and in IB it wraps properly. But when I run it, the view in the simulator doesn't wrap, and instead is truncated.

Screenshot

AstroCB
  • 12,337
  • 20
  • 57
  • 73
Mike Yawn
  • 115
  • 1
  • 6

1 Answers1

2

Do you have a corner radius set on the containing group? If so it will clip the corners of the image.

bgilham
  • 5,909
  • 1
  • 24
  • 39
  • 1
    Yes - the radius was set to 'default', by changing it to 'custom' and zero I was able to stop it from rounding the corners. – Mike Yawn Mar 17 '15 at 00:18
  • 1
    Rounded _is_ the default. Glad that part is figured out. – bgilham Mar 17 '15 at 00:21
  • Also, seeing that the radius was an attribute of the group, I was able to round all 4 corners by creating a group containing just the image, then putting that group inside the group that puts the image and text together. It seems that the label starting wrapping at that point as a side effect -- so getting exactly the look I want now. – Mike Yawn Mar 17 '15 at 00:26