Xcode 9 - Labels overlapping on iPhone SE Screen size - xcode

I don't know what constraint I need to add to prevent the labels from overlapping on a smaller screen size. I've tried placing a horizontal constraint between the two labels, however on larger screen sizes, the symbol label doesn't stay at the end of the view.
These are the constraints I've made for the two labels.
https://i.imgur.com/cicPYBR.png - Constraint 1
https://i.imgur.com/cicPYBR.png - Constraint 2
This is what it looks like on iPhone SE.
https://i.imgur.com/yxE9ce7.png

Easy Way
Use Stackview and add both of your view
With Constraints
To your left label (Where I can ..) add
Leading , Top , Bottom , Trailing (>= Relation) (with right side view which has play icon)
To your ride side view (which has play icon) add
Top, Bottom, Trailing (= relation ) (with super view) , Width (Whatever your constant with >= Relation )
In your first label you can set number of lines 2 and line break mode to word wrap to encounter ... in small devices
Hope it is helpful

Related

Xamarin Forms - Why Is LineBreakMode TailTruncation Causing Word Wrap

In a Xamarin Forms project (C# code, not XAML), I have a some nested horizontal stacklayouts that look like this:
Notice there's a "Declined:" Label, then a quantity Label (4), and then a reason code Label ("Can't Find"). I have set the reason code Label to a LineBreakMode of LineBreakMode.TailTruncation. I would expect that when the label gets too long to fit on the line, it would truncate it with ellipses. It does. However, it doesn't do it gracefully - it causes things to be squished and to word wrap, like this:
I have set the "Declined:" Label to LineBreakMode.NoWrap, and you'll notice the last "d" in "Declined" is cut off". I haven't set any LineBreakMode on the "Ordered" and "Picked" Labels, and you'll notice those word wrap. Why is this happening, and how can I fix it?
Does it look normal again when you rotate the device or if you call ForceLayout() on the parent element to all of those nested StackLayouts?
I have noticed that sometimes I must do that to force a redraw or layout pass on certain devices (usually is it only needed on one platforms or another as opposed to all platforms).
If that doesn't work, I would suggest using Grid if that is possible in your situation. That is what I tend to do when I run into elements sitting on top of each other like this. I am not sure why it happens but Grid never fails me. Grid seems to be much more strict about spacing and does not let things bleed over like that

IcCube - Treefilter without scrollbar and with only limited number of elements

We try to use the treefilter in IcCube to show categories with subcategories. Now we discovered two problems, we don't know, how to fix:
We have 15 categories on level 1, but only the first 11 of them show. There is some space underneath, so it doesn't seem to be cut due to rendering:
We are not able to activate a vertical scrollbar, so when we unfold the tree, there are parts we cannot see anymore. The hotizontal scrollbar is there, but once the tree is too big (image 2) it can't be used anymore as well.
Did we do something wrong and there are options we didn't see, or are our problems due to some bugs in this widget?
Point 1)
Try to increase Max Member Count property on the Query Wizard tab of the widget (this number is for all the members to be managed, not only level 1 items)
Point 2)
Try adding {"cssStyle":"overflow:auto"} in the Content CSS property of the Box tab of the widget.

ZedGraph scrolling left truncates data

I am using a ZedGraphControl in a WindowsForms project in C#. The ZedGraphControl is V5.1.5.
The data in the control is static and I add it all before the form is shown. The X axis of the data consists of numbers indicating seconds offset from the beginning. in other words from 0 to some number of seconds.
I want to initially show the last 5 seconds, but provide a horizontal scrollbar so the user can scroll back and forth. I set the "graphPane.XAxis.Scale.Max = maxX;" where maxX is the largest X value in my data. I set the "graphPane.XAxis.Scale.Min = maxX - 5;".
The data starts off displaying the way I want it, but when the user scrolls the horizontal bar, bizzar behavior occurs.
As you drag the thumb of the scrollbar to the left, the beginning of the data shown in the grid moves to the lower values as expected, and the thumb of the scrollbar moves to the left, but the right edge of the thumb stays at the right of the scrollbar and you cannot move back to the right. It is as if the data to the right of the viewing range gets truncated as you scroll left.
I cannot find any reason for this nor any way to control it. Does anyone have any ideas about this behavior?
Ok, found it myself.
I found a fine article that describes scrolling:
Add a ScrollBar
In it the author specifically says "the scrolling will be wacky because the scrollable range has not been set".
I used the sample "Manually Setting the Scroll Range" and the part that I was missing is setting the zedGraphControl1.ScrollMinX and zedGraphControl1.ScrollMaxX properties. Once I defined these values everything started working as expected. I also found that in my case, the value of zedGraphControl1.IsAutoScrollRange had no effect, but I left it set to false to be consistent with the example. This would probably have an effect if the dataset is dynamic.

Cocoa Autolayout - Why can't I delete or modify the (purple) width constraint on a Text Field?

I'm building a simple application using autolayout, and I've run into a strange situation. I place a Text Field in an empty part of a large open view so it's not affected by anything but the super view, but when I try to modify the "Width" constraint to be >= instead of ==, it creates a new constraint and refuses to modify the old one. I can't delete it, or change any of its attributes, because it just creates a new one.
Here is a comparison of the two constraints, the purple one being the stubborn one, and the blue one being the newly created one.
Why is the purple rounded one not modifiable?
I have worked around the presence of undeletable-but-unwanted constraints in IB by setting their priority to 1. Doesn't seem like the Right Thing to do, but sometimes I'm not smart enough to be a Cocoa developer.
My problem had to do with with fact that there weren't enough other constraints added that the width would ever be forced to change. When I added more other constraints (such as leading and trailing space), I was then able to alter the purple constraint (in fact, it disappeared and I had to add my own).
It seems strange that you cannot add your own constraints unless there is a possibility of them being broken, but I guess that's the way it's been integrated into IB in some cases.
Lowering the priority of the purple constraints will also make them editable.
I had a similar scenario, where there were two multiline labels. Based on the content size, both should resize.
When the first label resized, it was overwriting the second label because the second one had a Vertical Space constraint( "Top Space to SuperView = 40". it's a system default constraint - purple colour) which I was not able to delete/modify.
If I tried to modify it as "Top Space to SuperView >= 40", it'd be changed to a user constraint( blue colour) and a new purple constraint "Top Space to SuperView = 40" would be created automatically.
I guess this could be the reason:
When I tried to change the constraint to "Top Space to SuperView >= 40", the label's default position is undefined : >= doesn't specify a default position. It specifies only a 'range of positions'. Then I added a new constraint by selecting both the labels together and setting the space between them as a constant.
Now, since the first label had a definite position (vertical space = 15) from the top border and the second label was 5 points below the first one, the second label got a vertical position defined. I was able to delete the purple vertical space constraint.
Now, if I remove the constraint between the two labels, the second one will no more have the defined position and system will automatically create a purple constraint for the label.
When you right-click on the constraint, select "Promote to user constraint". Next time you click on constraint, you will be able to delete it as now it is in the hands of the user/developer.

List Control Adds a Space for an Image to Column 0 When Subsequent Columns Have Images

I’ve come across a problem with Windows list controls (I am specifically using MFC, but it looks like it applies to all list controls in the Windows common controls library).
In my specific case, I want to create a list control that has two or more columns. The first column (0) is text-only and is used to allow the user to jump to entries by typing the text in that row. Column two (or three, or four, or whatever) has an image (or an image and text; either way).
This much is all well and good and can be done easily without problem, however the final list control then ends up having a space to the left of the text in column 0 (it may be on the right on an RTL system). This spacer appears to be reserved for an image and I cannot figure out a way to prevent it. (Arranging the specific order of the columns did not change anything.)
Looking around, I found some other people complaining of the same thing, specifically this thread which leads to this thread. The proposed solution does not work because as was stated, simply shrinking the width of column zero merely cuts off the text rather than the image spacer (plus, you then have to prevent and/or process any changes to column widths that the user tries to make).
Does anyone have any ideas of how to fix this bug short of writing a list control from scratch or using one of the too-fancy grid controls on CodeProject/CodeGuru/etc.?
Thanks a lot.
Did you try to change the iIndent member of the LVITEM struct? MSDN says this:
iIndent Version 4.70. Number of image widths to indent the item. A
single indentation equals the width of
an item image. Therefore, the value 1
indents the item by the width of one
image, the value 2 indents by two
images, and so on. Note that this
field is supported only for items.
Attempting to set subitem indentation
will cause the calling function to
fail.
Column 0 is special in a ListView. As soon as you assign a small image list to the ListView, the control expects you to show an image in column 0, so it leaves space for it.
Solutions:
make column 0 zero-width, give it the value you want the user to be able to type. Column 1 becomes your "first" text column. Columns 2+ are for your images. You need full row select style for this to work. Yes, you have to prevent the user from resizing column 0. Yes, that is a pain.
make a column that does have an image to be column 0 and use LVM_SETCOLUMNORDERARRAY to rearrange the display order
owner draw the items.
give column 0 an icon (just to cover all bases)

Resources