I've some list of UI items - they placed one under another.
Right now each of this UI items have top space constraint to previous item. Some of items can be hidden according to data received from server.
How should i hide elements in this case so there will be no empty spaces in interface.
P.S I know few ways to do this technically (change top constraints values from code or hide element by "hidden" property), my question is not about how it could but how it should be done.
Setup those UI element in UIStackView.Then when you will hidden them they will not leave empty space.
Inside the UIStackView you also have to use the hidden property of those UI elements.
Related
I have a Kivy app that uses a slightly modified Settings as a data record editor.
I want to hide or show an item after the setting panel has been created (depending on user interaction with some other setting item).
Is there a simple way of dynamically hiding a setting item, so that it doesn't take up any space?
I can set the opacity to 0 and disabled to True and the items disappears, but still takes space.
Setting the size to (0,0) (to hide) and resetting it to the original value (to show it) corrupts the view.
What is the correct way of doing this?
Removing the SettingItem seems complicated, because the items to hide a somewhere in the middle of the items.
I am creating a form in my iOS app in which certain text fields need to be hidden depending on the number that was entered in the previous field. For example if 1 is entered there will be one field, if 4 is entered there will be four fields etc. all the way up to 25. I understand how to hide the buttons depending on number...the problem is when I hide the buttons they still leave the white space because all the fields are set up to position at x and y height. I have tried to put the inputs into a table view because I thought it would allow me to hide each table view cell containing the input and then move the rest up. But XCode gives me an error saying I can't connect IBOutlet to repeating content. Positioning the x and y height in the code won't work either because I need to do this a few times and there would be too many variables.
I have looked for a solution everywhere and haven't been able to find a solution. Does any one know how to hide text fields and make everything else below move up?
You could use autolayout by anchor each textfield to the one above.
Or you could give a tag to each textfield and then iterate with a cycle for till the index of your previous view to setHidden:false to the textfields
I've customised the style of a Firmeonkey list box item in such a way that now it can consist of 4 TLables in it. Each of the lable has Alignment as alNone.
I'm setting position of each of them in my code whenever i need to add any item. I've observed that when my list has scroll bar and if first component is not visible (i.e. i've scrolled down enough) at that time if i re-add all the items again in list box, then the position of TLabels in first items (or items which are not shown) get distorted.
For setting positions I am using below code :
(tmpListBoxItem.FindStyleResource('txtCol2') As TLabel).Position.X :=
(tmpListBoxItem.FindStyleResource('txtCol2') As TLabel).Position.X + (tmpListBoxItem.FindStyleResource('txtCol2') As TLabel).Width;
Any suggesstions, how can i overcome this issue.
Regards,
Padam Jain
Firemonkey styles are repeatedly 'applied' and 'freed' as components appear and disappear from screen.
It is not enough to simply set properties of style objects once and expect those values to be remembered. What you need to do is either listen to the OnApplyStyleLookup event or override the ApplyStyle method of a custom component and use the same you have above to set the properties again.
This means you'll need somewhere to store the values you are going to set.
I would suggest for your situation that you subclass TListBoxItem so you can add suitable properties or fields and put your code in ApplyStyle.
i am generating a label in a view with label text retrieving from a JSON file.
now there are certain texts(values) retrieved from the JSON file that are user interactive texts (URL/some action) and some are not.
Now i am retrieving the data which are user interactive, setting them as text of a UILabel (which i created dynamically) and setting it in the view (PS. my view controller only has a 2 views inside,one that is default and another in which i am generating the label).
The problem that is arising is that the interactive strings(labels) are set in one line and the ones that are not interactive are set in the next line(as i am creating individial labels for them) even if its a single word.
I want to set the labels (with the texts - interactive/noninteractive) side by side untill there is no space.
Cant wrap my head around it because its a logical problem.
Any help is appreciated
I'm tring to make come UI test using Coded UI. Unfortuanley, It seems to not have access to all DOM elements in browser.
I want to assert value of one text block in form, and by"Add Assertion" the lowest element i can assert is form itself. All tags contained by form was flatten and putted to "id" property in "Add Assertion" widnows, like in the screen below:
Is there a way to assert only one tag in form? In this case i want to assert value "Szczegóły przesyłki: 0--1526203258"
It depends on how your web page is designed. From the image shown it it not clear what field contains the Szczegóły przesyłki: 0--1526203258. However, given (1) the scroll bar and (2) that the Id field is shown and is empty, it is probably the Inner Text field.
Given the number of lines shown above and below the required text you are likely to have selected a larger than necessary part of the screen. When creating an assertion is it often best to move the cross hairs tool around the screen to find the smallest control that contains the required field. Such a UI Control will have no child controls.
I have found that occasionally the Coded UI cross hairs tool loses its place and leaves all four (UP, DOWN, LEFT and RIGHT) arrows grey and inactive, as shown in the screenshot. When this happens try clicking the refresh button located between Add Assertion and the arrows. Some of the arrows should then be shown as black and active. If the DOWN arrow is grey (inactive) and some of the other arrows are black then the properties panel shows a UI Control that has no child components. You should be able to find a UI Control that contains only the required text.