After a Root Element is made and displayed, I sometimes need to add a new section:
this.Root.Add(MyNewPopulatedsection);
The problem is that the new Section 'flys in' from the right in an animation.
How do I add a section, but not have it animate?
Most likely this is very inefficient, but can you just create new Root element with old and new sections and then reassign your DialogViewController.Root to it.
Related
I'm trying to add a new indented row as a child of an existing row and it just adds a new row to the bottom of the sheet instead of indented underneath parent row.
new_row = ssc.models.Row()
new_row.cells.append({
'column_id':5050181304510340,
'parentId':1379272254089092,
'strict':False,
'value':"test_value",
})
response = ssc.Sheets.add_rows(6110498509875076, [new_row])
Thanks for any help.
Seems like you have a typo in one of the property names. Try changing parentId to parent_id instead.
Also worth mentioning that the Specify Row Location section of the docs contains some good info about how to set various row properties to specify row position. (Mentioning this here mainly for the benefit of others who may find this thread later while looking for info about row positioning).
OMFG...been working for 2 days trying to return the parent and sibling and turns out it's a typo in the docs. This post is $$$
print(row.parent_id)
print(row.sibling_id)
print(row.row_number)
I have one element in UIStackView. Then, I add the elements dynamically as follows.
stackView.addArrangedSubview(view)
However, they always add these elements to the end of the stackview. How can I make the new addition always add to the top?
You can just do this:
stackView.insertArrangedSubview(view, at: 0)
which inserts to view at the start.
Having a infinite scroll (with new items loaded by remote calls) together with collection repeat and items of different size, I have an issue that after new batch of item is renedered, the scrollbar "jumps" to the middle, or to explain it other way around, it is not on the bottom where it should be (on the button but moved a bit back to accomodate for the new items).
The most probable issue is that
this.$scope.$broadcast('scroll.infiniteScrollComplete');
is called BEFORE the items are added to the array / rendered.
One easy way to do this is if items are added as a result of a promise, but $broadcast is done before the promise is completed.
solved this by setting item-render-buffer property of collection-repeat
<div collection-repeat="business in businesses" item-height="120px" item-render-buffer="10"></div>
I was wondering if someone could explain to me how I update a list at runtime in Unity?
For example I have a spell book, which has 3 spells in it, when I drag them to my action bar they get re-parented to it, what I'm trying to do is get a list of each child under the actionbar transform,
My problem is where to actually do something like this if I try something like below in the update, it adds whatever's there many times, which I can understand since update runs every frame..
list = actionbarui.GetComponent(UIGrid).GetChildList();
for(var i =0;i < list.size; i++)
{
buttonList.Add(list[i].gameObject);
}
If I add a callback to the buttons so that whenever they're drag and dropped it runs the above code and add thing's additively, as in, if you drag just one "spell" on it will loop through once, which is fine, but as soon as you add another it loops through three times, that is, it already has one it then adds the same one again PLUS the new button that's just been dragged on for a total of 3.
I've tried changing the code to
list = actionbarui.GetComponent(UIGrid).GetChildList();
for each(var child : Transform in list.GetEnumerator())
{
buttonList.Add(child.gameObject);
}
But this simple doesn't add anything, I am unsure how to go about keep the lists update as they are dragged off and on, could anyone please explain how this is achieved?
Please ignore the second "list" code, it's implementing "BetterLists" as apart of NGUI, so doesn't follow standard list methods.
Thank you for reading
If I add a callback to the buttons so that whenever they're drag and dropped it runs the above code and add thing's additively, as in, if you drag just one "spell" on it will loop through once, which is fine, but as soon as you add another it loops through three times, that is, it already has one it then adds the same one again PLUS the new button that's just been dragged on for a total of 3.
That is the expected result here. You are running through the list of children and adding them to your buttonlist, so first time there is only one item to add, then when you add another child there are two items to add, thus resulting in three items.
Either don't have a for loop and do:
buttonList.Add(the_GameObject_that_was_just_added_to_the_bar);
Or clear your buttonList before the for loop:
list = actionbarui.GetComponent(UIGrid).GetChildList();
buttonList.Clear();
for(var i =0;i < list.size; i++)
{
buttonList.Add(list[i].gameObject);
}
Alternatively to Dover8's response, you can first check if the buttonList already contains a reference to the child to be added. If it does, continue. Otherwise add the new child.
However, given the expense of doing the checks, and since you are already looping through the list already, I'd recommend that you follow his suggestion to clear the list before running the loop. It will probably give you the best performance out of these examples.
If there's a reason you can't or shouldn't clear the buttonList, and you still need to run through it, I'd recommend my suggestion. It really depends on which implementation works best for what you are trying to do. The point is that there are several ways to do this, and they have different performance profiles you need to consider.
I have a CTabFolder with one of its CTabItems which may change its contents on a given user action. But I don't know how to force the display once the contents have changed. I get the tab item blank; if I resize the window suddenly everything appears.
I'm not posting the code because I did some wrapping in Scala, but this is basically what I'm doing:
The CTabItem has a ScrolledComposite, set with setControl()
The ScrolledComposite contains a Composite
everything else is under this Composite
When the contents need to be changed, I take the existing CTabItem object, set it to a new ScrolledComposite, with a new Composite, from which hangs the new contents.
Calling redraw() and update() on the CTabFolder object doesn't do it... What should I do?
Thanks
Have you tried calling layout()?