I'm trying to add a label to StackView, but the text in label is too big to display it. So I'm setting lines to 0 and after that my StackView escapes. I've set top, leading and trailing constraints for main StackView. Does anybody know how to fix this problem ?
It must be like this
But when I'm changing linebreak to 0 it become like on 2 screenshot
The problem was that I used the version of XCode 9.1, which had this bug in it and did not test the application on the simulator. Upgrading to a newer version solved this problem.
Related
I am designing my app UI with the GUI Builder. I created a new Form and defined a style as follow :
FinishFlagIcon {
background-image: url(pics/FinishFlag.png);
cn1-background-type: cn1-image-scaled-fit;
cn1-source-dpi: 320;
font-size: 11.9mm;
}
I set this style on a label and it appears on the GUI Builder.
However when I launch the project in the simulator it does not appear anymore.
I also tried to use a Scaled Label and defined the icon as FinishFlag (which was present in the res file), and again it appeared in the GUI Builder but not in the simulator. Of course there is no error printed in the console telling me the file could not be found.
Please note: the res/myCustomTheme.css folder holds all the subfolders related to the png (and those subfolders are populated with low to hd pngs) and the src/theme.res has the pictures (folowing Shai's advice) :
So what should I do to make the picture appear in the simulator ?
Edit : I tried to hand code the UI and added a Label (with the UIID defined above) to the the central area of a BorderLayout. I does not appear either until I add 3 spaces or more to the Label. I did not try again with the GUI Builder. It looks odd to me, is it done on purpose ?
Edit September 13th 2017 : If I build the app and open it on a real Android device then the labels appear.
Edit September 15th 2017 : For people having the issue of component not showing, as advised in the accepted answer the solution consists in removing top or bottom constraint of the component not showing and setting it to auto (click on the lock) so that there is enough space for the components. So eventually after setting to "auto" the bottom constraint of the progress bar an labels the expected result appear on the simulator :
Any help appreciated,
The images in your issue are a red herring. It looks like the problem is with your layout insets. Notice that none of your lower components are showing up in the simulator. The "progression" label, the three zeroes, etc...
I can't see the constraints you are using for the flags or the zeroes labels, but I can see that the "progression" label has fixed insets on both top and bottom. This may result in a zero height if there isn't enough space for it. Try changing either the top or bottom insets to "auto" so that they are flexible.
Try changing the simulator to use the desktop theme so that you can resize the window and see how the form looks at different sizes.
You can also easily verify this by overriding the layoutContainer() method of the form, and check the height that your flag label is getting:
public void layoutContainer() {
super.layoutContainer();
System.out.println("finishflag height: "+gui_FinishFlag.getHeight());
}
I'm not sure what's the "right" solution for this so maybe Steve can interject but this is what's happening.
You have two resource files: theme & theme.css.
The images in theme.css work great for your styles. However, since the loading process loads theme and not theme.css the simulator is unaware of these images as the theme res file doesn't know of them.
The GUI builder is probably scanning all the res files here so it lets you do that which might be a mistake... You have the following options to workaround this:
Load theme.css and discard theme - you will need to define the inheritNativeThemeBool flag and should no longer use the designer tool if you take that approach
Use the designer tool to load the images rather than CSS
Explicitly load the css res file using Resources.open and explicitly pass it to the Form
Explicitly load the css res file using Resources.open and set it as the global resource file
i'm writing a qt app that should use right to left layout but there is a problem with displaying strings that include space,digits and letters in qtreewidget and qtablewidget. for example when i write 65 %c it shows as c% 65 and of course date times shown as "22:10:06 2015-01-06" instead of "2015-01-06 22:10:06"
how can i fix this?
screenshot:
thank you
When you use rtl layout all children assume that your writing language is also rtl.
Digits are universal so they are treated depending on this setting.
When you use ltr characters (Latin for example) this gives this "funny" side effect (it is even more funny when you edit this text, cursor will jump to different position when moved by arrows).
One way to fix it is add Unicode Left-to-right mark characters where it is needed.
IMO it would be better do not use this feature (rtl layout) if your language is ltr. Let locale setting do this magic.
Can you explain how and why did you used "rtl layout"? What did you tried to achieve that you have decided ti change text direction?
I'm trying to create a text editor with line numbers, which increments with the lines increase. Well, my focus is to make the UI that will do good in Firefox OS as a privilege app. But in UI what css and html need to be used to create a text-field where line numbers must not be editable by the user. And few other thing say like, text-field is fixed height height: 100px; now if text overflows and if the user scroll then line numbers must scroll together with respective lines. (I'm trying to create with textarea and div with contenteditable="true"). I'm not able to scroll the text-field if I try this. Please provide some help or any other way to do this.
As someone who has worked on this problem for over a year at a previous company. Just use one of the existing source code editors like Ace or CodeMirror. They'll work in a Firefox OS app as well (f.e. Cloud9 IDE uses Ace and works on FFOS).
My Xcode has suddenly began to display unreadable text in the source editor. No other apps are affected. It is most notable with white/bright-colored text on a black background but it occurs in every theme.
The text looks like the the background is bleeding through the foreground text characters. It doesn't really look like "the jaggies" that you used to see with bitmapped fonts.
Here is s side by side comparison between Xcode and the terminal using the same orange on black theme, at the same font of Menlo 12. Even in the reduced resolution screen shot, the difference is obvious. On screen, the terminal text display is crisp and easily readable while the Xcode text is barely readable and, as a practical matter, useless.
I don't know when the problem may have started because I haven't been working in Xcode recently. The only change is that I added a second monitor to my dev box but removing the monitor did not resolve the problem.
I tried using the com.apple.dt.Xcode defaults to set the anti-aliasing of Xcode to 24 point but that too had no effect.
I'm stumped. My next step will be to reinstall Xcode but I was hoping someone else may have hit this problem before and has a neater resolution.
A reinstall of Xcode resolved the issue. Haven't the foggiest why.
Update:
This answer over at Ask Different might be relevant as well.
Based on Qt 4.5.1
I placed QWidget, created with QWebPluginFactory, into HTML page.
...
...
TestObject works just fine, also JS communication with it. But i found two problems:
I cant draw no HTML elements above QWidget(positioning absolute and setting z-indexes). Is there any way how to set rendering order in WebKit? Or to make z-index work ? Changing width, height and other properties works just fine.
When i hide parent div for testObj (display:none) and show it again(display:block), WebPluginFactory is called again and original object is destroyed. (Currently my workaround is to resize TestObj to 1 * 1 pixels, so user doesnot sees it).
Does anybody knows how this works exactly? Is something of this fixed in 4.6 ?
Thanks
I was having similar issues with 4.7 release. It looks like it is still not fixed just yet: check here