Popover (from ngx-bootstrap) placement isn't working with ngx-datatable + ngx-translate - ngx-bootstrap

I'm trying to add a popover on a button but the placement isn't good.
Here is a screenshot :
You can expriment it here : https://stackblitz.com/edit/ngx-translate-example-ruqwa7
I've been able to find the problem but not the solution.
The user clicks on the delete button
Html for the popover is appended in the html. But there is nothing in the body because translations aren't calculated yet (I'm trying to understand why)
a function calculates the required positioning
translations are loaded (too late)
What I noted that was interesting
In the stackblitz, I made en "emulation" without the datatable (with the red square). In this case it works because the translations are loaded before the position calculation is done
Without translation, by hardening the content, there is no positioning problem.
Why is the position calculation done after loading the labels? This is obviously due to the ngx-datatable. Because without the datatable, the position is correct.

Related

Understanding collapsible box layout and sizing

I am working on a Qt-UI with PyQt and found this nice snipped to create a custom collapsible box widget here: How to create collapsible box in PyQt
I have just replaced the internal QScrollArea by a QFrame.
It works perfectly, as long as the content of the layout that is added stays the same.
However, I allow the user to add or remove widgets from that layout dynamically during use. Here I need some help. I am adding a Grid Layout with, say, 3 widgets inside there (initial creation of the box with .setContentLayout) and once the user adds a 4th widget:
the layout is compressed and keeps its original size
all widgets inside are compressed to fit in the newly created one
overall size of the collapsible box is kept constant.
I have played with various options like updateGeometry() on the content_area and all surounding widgets. It seems I don't fully understand what this code does, I am not really familiar with these animations yet. My best guess is, that the animation somehow blocks the update of the height of the collapsible box, causing the layout to be compressed.
I would be really happy for a pointer where to look / what to adjust to get the size of the collapsible box reacting to the size of the containing layout.
Thanks!

Text field problems Xcode

I’m creating an app and need to make a signup/login page. I added a background using a picture and a zstack and on top I have the text and text fields. The text fields are showing up but not allowing me to add padding as well as there is no title text showing. Please help.my code
Did some more testing to find out that this happens whenever I use a textfield over an image. Not sure if this is a bug or not but it seems to be because as soon as the zstack is removed everything works.
At last ive discovered the issue, the text fields are extending way out of the canvas. Ive fixed the width of the textfield as a temporary solution but still looking for a way to fix this relative to the screen rather than the background as the field extends to the size of the image. Let me know if you can help as im just starting to use xcode!
I think its because the image cause canvas to be much more bigger and you use edgesIgnoringSafearea(.all)
Try to use on the image clipped() method and i think it will fix your issue with the padding.
And also try to add foregroundColor to the test fields

Widget Simulator does not display elements of "Today Extension”

I want to implement the “Today Extension” feature into one of my applications. I successfully added the extension, gave it a run and saw the “Hello World” screen on the simulator. I then deleted the "Hello World” label, and added my own labels to the view. Nothing spectacular and really nothing I thought which would make me any trouble…
Now when I run the widget all I get is an empty Simulator:
Things I tried:
Checked that "File’s Owner" has the view connected
Coloured the labels and made sure they aren’t hidden
Checked if the view’s controller gets initialised accordingly
Fiddled around with Autolayout: The extension view does look like a (too) small bar compared to the size I assigned. The strange thing is, that even if I drag one label to the top, it does not appear
Tried a “Clean” and “Clean Build Folder” and also “Clear Snapshot” in the simulator
Downloaded a working today extension from Github to check if I did something wrong. Couldn’t find anything.
It does seem like I’m working on the wrong view. But it is in fact the same view which displayed me the “Hello Word” label. Am I missing something? (#Moderator: I suggest adding the following tags: osx-today-widget, widget-simulator. Thanks in advance.)
Without the code it is hard to say, but maybe this helps:
what text color does your label have?
make sure to give it "Control text color"
what is your minimum height>
click the "Custom view" in your xib file (the root view) and click Editor > Pin > Height.
Set it to 200 and "greater or equal than"

live tiles in Windows Phone and Grids

I'm trying to create a live tile for my application, using a user control.
The user control contains a grid, an image and a rectangle filled with color.
Now here comes the funny part.
I want the rectangle to act as a background for the tile's title, and the image to fill the rest of the tile. And i said to myself, well, lets put some rows in that grid and set the like you usually set them in a WPF/SL application.
I then write the entire thing in a WBM and save it to isostore.
The problem is, the parser seems to ignore the presence of grid's rows. regardless of what I try, the rectangle is not shown, and the image covers the full tile, when it should only cover the first row. It is as if the grid didn't even existed.
Another funny aspect is that it doesn't matter if I use rows or columns, the result is the same.
Any ideas?
Are you using the following method?
Dynamic LiveTile - adding background image?
I recently implemented a Live Tile using a Grid with Rows and Columns for layout of some TextBlocks. I encountered similar challenges, so I placed the control that I was using for my Live Tile on a blank page in my app to better see what was happening. Does the control render correctly when displayed on a page (versus being rendered to a WriteableBitmap)?
Another idea. Instead of trying to position the Rectangle relative to the tile's Title, why not leave the Title property blank and put the same text in a TextBlock within the user control?
If you are careful about the font and positioning of the TextBlock, the text on the resulting background image can appear indistinguishable from text displayed from the Title property. I decided to follow this strategy myself. I found the font information in the following answer:
Font size and family for a tile's title
Otherwise, could you post an example of the XAML you are using?

Creating a view for user to fill up a form

I'm creating a view which provides some fields for the user to fill in - address, phone number etc.
I've seen apps that have populated fields with grey text like 'Fill in your name here' on the Name field, and when the user taps on it the text is gone, a keyboard appears and the view is zoomed in to the textfield(or whatever it is). Also, after filling up that field tapping the 'Next' button on the keyboard brings the user to the next field. I'm trying to do the same but I have no idea where to get sources on this. Pardon my poor googling skills ;p
Tried UITextView and UITextField but there isn't anything related to this on the Interface Builder. Figured it lies with the codes?
It'd be great if I can get some explanation or some links on how this works (: Thanks!
EDIT: okay I played around with the Interface Builder a lil more and realized I could set placeholder as the grey text.
It is in fact a UITextField.
You can get the greyed out text by setting its placeholder property.
I am not sure what you mean by zooming but usually they do use a scroll view or adjust the frame so that it isn't blocked by the keyboard.
The Next button is made available using a UIToolbar instance as the text field's inputAccessoryView. However the implementation is one's own and is not framework provided. You can look at this example to get started.