I try run this from Xamarin.Forms.Sample repo https://github.com/xamarin/xamarin-forms-samples
Under folder UserInterface/PlatformSpecifics with :
ios:Application.EnableAccessibilityScalingForNamedFontSizes="false"
This flag is set to disable scaling of fontsize, however when I go to ios settings Larger Font Size and increase the size, look like that disable doesn't work at all, what do I miss here? or is it a bug?
Check this PR , it adds the functionality of disable accessibility sizing for named font sizes .
You can see in that class it affects the font size returned from GetNamedSize method, and check the following screen shot you could find out those controls which will be affected.
So PlatformSpecifics API only works on some specifc controls , it does not affect ViewCell and TableSection in your scenario .
As a workaround , you could replace TextCell with ViewCell and place a Label inside it ,something like
<ViewCell>
<Label Text="fdhfihdif">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding}" CommandParameter="{}"/>
</Label.GestureRecognizers>
</Label>
</ViewCell>
Consider raising feature request on github what you want .
Related
I am using antd and want to remove the antd blue border and resize the input box to small. Below is my codes, which I have added size="small" and bordered={false} and it worked on localhost. However when I pushed it to a staging platform, it didn't capture the codes and revert back to default.
<Input
size="small"
bordered={false}
ref={inputLocation}
className={styles["input-field"]}
value={location}
/>
The codes also showed up on the staging platform when I clicked inspect.
[1]: https://i.stack.imgur.com/Lfx4Z.png
For your kind advice please, thank you!
When I try to create a DatePicker it appears all white, and only the selected date is black which I changed through the Textcolor property. The rest of the graphics appear fuchsia in my case. How can I change the rest?
This is a known bug in Forms with Dark Theme.
There was a workaround posted recently
This is a super-ugly hack, but it solved the problem for me. Based on what #stefanbogaard86 suggested, I tried using Visual="Material", but the problem I ran into was that the DatePicker entry box didn't match the rest of the form. But, he's right that using Material did fix the issue with the picker rendering. So, I found this to get the best of both visuals:
<AbsoluteLayout>
<DatePicker
AbsoluteLayout.LayoutBounds="0,0,1,1"
AbsoluteLayout.LayoutFlags="All"
Date="{Binding Birthdate}"
Format="yyyy-MM-dd"
Style="{DynamicResource DatePicker}" />
<DatePicker
AbsoluteLayout.LayoutBounds="0,0,1,1"
AbsoluteLayout.LayoutFlags="All"
Date="{Binding Birthdate}"
Format="yyyy-MM-dd"
Opacity="0"
Style="{DynamicResource DatePicker}"
Visual="Material" />
</AbsoluteLayout>
The first picker is what we want to show in the form. The second one is what we want to be clickable and show the full date picker, but we don't it shown in the form, so its opacity is zero. They're both bound to the same property, so when you change the value they both work.
Like I said, this is super-ugly, but it works.
First of all, let me apologize for not including code. I tried to reproduce this issue with a smaller project but was unsuccessful. The issue itself is sporadic as well, so it is difficult for me to nail down the culprit.
Basically, what is happening: I have my UI defined in FXML and it includes several labels throughout, some of which I have set the font to "Bold."
<Label text="Appetite Info:">
<font>
<Font name="System Bold" size="12.0"/>
</font>
</Label>
The problem is that, as the user clicks around the UI, all of these labels will be reset to "Normal" font weight. Sometimes it is giving focus to a text field or scroll pane, other times it happens just when the main UI window loses focus.
I do have the application styled with CSS, but this happens even with a Default.css that doesn't override any formatting:
.root {
}
Has anyone else noticed this behavior or know where I should look for a solution?
I'll mark this as answered. Styling all my nodes with CSS instead of through the FXML markup solves this issue.
I am having a weird problem with JavaFX and Font Awesome, which I'm having trouble pin-pointing the cause of. The problem is further complicated because I can't really share the code, and no matter how much I've tried to replicate the problem in a simpler case - I couldn't.
The problem is as follows - I have a TableView, in which every column has a Hyperlink as a graphic, with a Font Awesome glyph. This all works well, except for one stage - in this stage, the first time it is shown everything is fine, but the second time three of the columns' glyphs revert to squares. This is weird, as all columns use the same glyph of the same font.
Here are before and after pictures - notice the glyphs are all the same, but the left ones become squares:
The glyphs and font are set through FXML, and are the same for all columns:
<TableColumn fx:id="col1" prefWidth="83.0" text="Column 1"><graphic>
<Hyperlink onAction="#requestFilter" text="" visited="true">
<font>
<Font name="FontAwesome Regular" size="13.0" />
</font></Hyperlink>
</graphic>
</TableColumn>
<TableColumn fx:id="col2" prefWidth="138.0" text="Column 2"><graphic>
<Hyperlink onAction="#requestFilter" text="" visited="true">
<font>
<Font name="FontAwesome Regular" size="13.0" />
</font></Hyperlink>
</graphic>
</TableColumn>
<TableColumn fx:id="col3" prefWidth="59.0" text="Column 3"><graphic>
<Hyperlink onAction="#requestFilter" text="" visited="true">
<font>
<Font name="FontAwesome Regular" size="13.0" />
</font></Hyperlink>
</graphic>
</TableColumn>
<TableColumn fx:id="col4" prefWidth="103.0" text="Column 4"><graphic>
<Hyperlink onAction="#requestFilter" text="" visited="true">
<font>
<Font name="FontAwesome Regular" size="13.0" />
</font></Hyperlink>
</graphic>
</TableColumn>
Here the last two columns are the ones who lose their glyph (the scene is in right-to-left orientation).
Furthermore - it is always the last three columns that lose their glyph, that is - if on the first showing I reorder the column, the columns I leave last in the table (to the left, again - the scene is right-to-left) will lose their glyph the next time the stage is shown. Subsequent hiding/showing won't lost any more glyphs.
I show the stage with Stage#showAndWait, and I keep a reference to the stage, so it is only created once.
I realize it is hard to help when I can't share any code (client confidentiality), so what I'm asking is - where can I look to see what is happening? How come some instances of the same glyph disappear and others don't? Did anyone else encounter something like this? What was the underlying reason?
Edit: I have added debug prints of the hyperlinks' properties, and indeed with the second showing the font reverts to "System" for the last three columns. Looking for the source of the change, I have added a change listener, and put breakpoint inside it. The stack shows that the change happens inside applyCSS, after a lot of internal calls following showAndWait, non of them in my own code (i.e. - all in the JavaFX library code). It seems for some reason JavaFX decides to reset the font definition of some of the controls, although they are all defined exactly the same! This is corroborated by the fact that it doesn't matter which table-column it is, but where it is in the TableView.
So it seems like some erroneous JavaFX behavior is resetting the font to the default ("-fx-font") instead of the one defined on the node itself. Anyone know enough about the JavaFX CSS logic to help find the bug?
All hyperlinks have no custom styles or classes set, and only the 'visited' pseud-class set.
Edit 2: Adding a font name to the CSS fixes the issue. I would still love to find the source of the bug (which, I am certain, is in the JavaFX CSS handling), but it is too messy for me to go through it now. The CSS I use is:
.table-column .hyperlink {
-fx-font-family: "FontAwesome";
}
My bet that some code or css styling somewhere is changing Hyperlink font or style or css class. You can use some debugging. For example, you can add button near your TableView to print some debug information, something like this:
Button b = new Button("Debug");
b.setOnAction(e->{
TableView<?> tv = (TableView) scene.lookup("#tableView");
for(TableColumn<?,?> tc : tv.getColumns()) {
Hyperlink link = (Hyperlink)tc.getGraphic();
System.out.println("Column "+tc.getText());
System.out.println("link text: "+link.getText());
System.out.println("link Style: "+link.getStyle());
System.out.println("link CSS Classes: " + link.getStyleClass());
System.out.println("link CSS Pseudo Classes: " + link.getPseudoClassStates());
System.out.println("link Font: " + link.getFont());
}
});
Then click this button when table looks normal and save debug info somewhere. Click again when squares appear and compare the output with first one. Also inspect your css files and code that can access TableColumns, if any of those can affect Hyperlink styling.
EDIT
Well, it seems pretty strange to me, that JavaFX all by itself internal logic decided to recalculate and reapply css styles only for specific columns and not for the whole scene (EDIT: according to JavaFX CSS Reference it actually can reapply css only on specific branches in scene graph). I still think that the root cause somewhere in your styling or code. I doubt anyone could point you to a place to look at, as it seems very specific problem and, as you said, can't be reproduced in simple scenario. Maybe you perform some specific layouting logic, recreating/replacing table nodes or somthing similar, hard to say not seeing the code.
Anyway, if you just want to solve the problem, I would suggest to set hyperlink font style in css file, not in fxml. This way you ensure that even in case of css recalculation or any layout manipulations style will be the same. It would be the right way to do it anyway.
If you want to dig up the real cause of a problem, I afraid you have to spend some happy hours with your debugger:) I would start from searching the differences between normal column and column with broken font. Why do they treated in different ways?
I have my own toolbar with toolbox and toolbarpalette.
I have followed this https://developer.mozilla.org/en/Skinning_XUL_Files_by_Hand
and background image for toolbar is not displaying, what can be wrong?
Cannot found any debug message in Error console
Note that Image #logoimage is displaying correctly
XUL
<toolbox id="navigator-toolbox" class="nav-box" crop="end">
<toolbarpalette id="BrowserToolbarPalette">
<image id="logoimage"/>
<toolbarbutton type="menu" label="&toolbar.quicklinks.label;" id="quicklinks">
<menupopup>
<menuitem class="menuitem-iconic" label="&toolbar.quicklinks.quicklink1;" image="chrome://tbar/skin/icon.png"/>
</menupopup>
</toolbarbutton>
</toolbarpalette>
<toolbar id="test-toolbar"
class="nav-bar"
mode="full"
iconsize="small"
customizable="true"
context="toolbar-context-menu"
toolbarname="Toolbar"
crop="end"
defaultset="logoimage,toolbarseparator,quicklinks">
</toolbar>
</toolbox>
CSS
toolbar.nav-bar {
background-image: url("chrome://tbar/skin/tbg.png");
}
#logoimage {
list-style-image: url("chrome://tbar/skin/logo.png");
}
As nobody could help, I asked in mozilla.dev.tech.xul Google group, and got an answer
Try adding "-moz-appearance: none;" to your CSS stanza. This turns off
OS-defined theming.
And that thing simply worked ! It also removes all OS specific look and feel effects
see: https://groups.google.com/group/mozilla.dev.tech.xul/browse_thread/thread/a4cd4452a72b9151#
Given that there are no issues in the code you show here I only see one explanation: the background image is being set to a different value elsewhere, maybe in some built-in CSS file. You can check the CSS rules applying to a particular UI element using DOM Inspector.
Does your toolbar have a height and width? I can't remember if they're block by default, but it might not be showing because it has no dimensions?