I'm currently developing an OS X app and I just stumbled across a pretty weird bug.
This is my app's UI on a 1x resolution:
and this is my app on a retina resolution:
Where did that location icon in the bottom right vanish to? The icon itself is an SVG file that's configured like this:
The NSButton element itself is held in place by Auto Layout constraints like it's supposed to.
Oh, also I don't have an actual device with a retina screen, I just moved the window to the second monitor that's configured to use a HiDPI resolution. This shouldn't be the source of the bug, but you never know.
Related
I use SkiaSharp canvas to draw the main game screen, and then there are various Xamarin.Forms Buttons around the UI. This all works fine on when used directly on iPhone or iPad using a finger. However, when I connect a mouse (e.g., through a MacBook or otherwise), the buttons start working with about 10% chance after mouse-clicking on the SkiaSharp canvas (and not receiving the mouse click events with 90% chance). The SkiaSharp canvas itself works just fine.
If I bring up the iOS app launch menu from the bottom (which probably somehow temporarily exists the mouse navigation on the app), the buttons start working again with the mouse. But if I click the SkiaSharp canvas again with the mouse, the buttons have a high chance of becoming disabled again. If I change to using a finger, all works fine (even if the mouse clicks were not being registered immediately before). However, mouse clicks are not being registered even after touching with a finger, so finger-touching does not reset the issue with the mouse (but bringing up the menu from the bottom does).
We found this bug by testing the iOS game on MacBook Pro (the iOS apps recently came available on the App Store) but the same issue persists also directly with an iPad / mouse combination. It seems to be some sort of an issue between using a mouse (on iPad or on MacBook Pro), SkiaSharp canvas and Xamarin.Forms buttons.
Does anyone know what the root cause of the problem is and what is the workaround?
Not an answer as such, but some more information about reproducing the issue: A simpler repro case may be this small project: https://github.com/jrc14/TraceMatching/ .
Don't worry too much about what it's doing, but note that you're mean to click in the grey Skia canvas in the middle to create 'targets' - and that after you've done that, mouse-clicks are getting lost.
If you run it on a Mac, you'll see that, though the clicks get lost after you've clicked on the Skia canvas, they will start being received again if you click on something else (another app, or the Mac background).
(further edit) - after some noodling around I did find a workaround. If, once you've finished processing the touch action on the SKCanvasView, you reset its EnableTouchEvents property (i.e. set it to false, then back to true again), it seems that the clicks don't get lost any more,
My actual application is using a bluetooth scanner in HID mode and capturing the input on the DispatchKeyEvent of the MainActivity. It works great except that the screens dims to some dark opaque color where it looks like everything is disabled and you have to navigate back to a page with an input control and tap on it to get the screen to go back to normal.
It's not as noticeable in the stock template but in my actual application (Screen shots at bottom) the dimming is very noticeable; it's a blue-gray opaque overlay that really stands out. I have no idea why it's like that. I'd almost just be happy if my actual app dimmed like the default forms sample.
Steps:
Make a Xamarin Forms app from one of the templates.
Change nothing.
Run simulator.
Press a button on your keyboard.
Result:
The screen dims and the soft keyboard does not popup.
Next Steps:
Add an Entry control. < Entry/> will do.
Click on it and the screen brightens back up.
Delete < Entry/>
Press a key on your keyboard and the soft keyboard pops up and the screen doesn't dim again.
What I want:
To know where the dim/overlay color/opacity is set so I can change it.
To not allow the soft keyboard to try and popup at all unless there's an entry field that has focus.
Here's screenshots from the default forms app:
Not Dim:
Dimmed after pressing the keyboard:
My actual test device is a Samsung Galaxy XCover Pro running Android 10.0. I'm working on porting a native Xamarin Android app to Forms so we can run it on iOS as well. I never had this issue with my android app and I'm not sure how to track down what's happening.
Here's a before pic. I've got an Entry field focused.
After scanning a barcode with my bluetooth scanner this happens:
There is NOT any overlay/modal boxview defined in the XAML. The overlay is nothing that I added. Though I seem to have done something to influence the color; I don't see anything in my styles.xml files that would change the color from the default light gray (as shown in the sample Xamrin Forms template).
I can reproduce this with a scanner on the "Welcome to Xamaring Forms!" as well, the screenshots don't really show the change in overlay color; its much more subtle; I really would like to know why in my app the overlay is so much more obvious.
I'm still annoyed it happens at all. But just in case anyone else using a
hardware keyboard as input (or a BT scanner connected as a HID) and you thought you'd be fancy and override one of the default styles and use a pretty green accent color like this: (though stupidOverlayColor has been changed to pink just to make sure I found the issue) - don't do it.
<!-- Base theme applied regardless of API level -->
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorControlHighlight">#color/stupidOverlayColor</item>
</style>
The moral of the story is that "colorControlHighlight" is evil and not to be overridden and used with hardware keyboards, unless you want your app to think the entire screen should get the highlight color after you scan a barcode like this:
I have a brand new Swift 2.0 XCode 7 Storyboard based application.
Target is set to 9.2. I'm currently supporting any device with GPS that can run ios 9.2
I started with the Tabbed View Template and I'm working in wAny and hAny and a single Storyboard.
It works fine in the simulator on a bunch of phones, both orientations and works fine on my 6s plus, 6s, 6 plus and a 5.
But for some users the scaling is wrong and everything comes out squished.
Even in landscape mode the TabBar Icons are very close to each other.
Narrower than even on my 6s plus in portrait.
I believe this is caused by my application not having a Launch bitmap.
My understanding is there are two ways to implement this.
Launcher .XIB/.NIB with half a dozen specific sized bitmaps attached. Or a StoryBoard Launcher with ... exactly what.
The "Or StoryBoard" is a little vague. But I wanted to keep things using the modern approach since this app is new and targeted users tend to have the latest device.
So I created my Launch Image set and tried to attached it to the UIImageView in the Launcher StoryBoard. It won't list items that are tagged as "Launcher Image Set". It will show other Image Sets and Icons. But not the ones specifically for Launcher. It shows an "L" in the xcassets list next to the Launcher Image set. I believe I have the build project setting set correctly and it looks perfect on many of the same exact devices.
After some digging, I read that if you use the "StoryBoard" method you don't need the 6 or so bitmaps anymore. You can put anything in the Storyboard Launcher View and treat it just like you would treat your main storyboard.
So I did that. I just centered a small image.png file in the View of the Launchers Storyboard. Works on all simulations and my iPhone 6s plus. I did not pin it to the edges because that would mess up the aspect ratio of the image.
A very small set of users still have the issue and one of them even uninstalled and reinstalled.
I tried playing with setting phone Zoomed, Normal, Text Size, Bold etc. They all work. Users also don't have anything out of the ordinary on these system settings.
So first, do I need the 6 proper sized bitmaps or not? I read conflicting info on this.
If I want to use the 6 images on a storyboard how to I get them in the UIImageView of the Launcher StoryBoard if they won't list? Should I put them in a regular image set. Does the "Launcher Image Set" only work for the for the Launcher.XIB?
If it's not the Launcher window, what else could it be causing this?
I know I could create a XIB/NIB with the 6 bitmaps. But that seems like I'm going backwards and I don't care about old OS versions or older phones.
I think I found my answer. When using a Storyboard Launcher you cannot use a "Launch Image Set" for your Launcher Storyboard. You have to use an Image Set.
This is the best Video I found that covers it A-Z.
https://www.youtube.com/watch?v=Vz6tCgXgZFo
It also didn't fix my initial problem. Which I'll post separately. It scales correct in Portrait but not in Landscape for hand full of users. Using the same hardware as others that it works fine on.
Is there any special requirement for icons used by Mac applications that such icons should have transparent pixels in the top-left corner or some other place?
I'm currently trying to prepare a Mac build of a Unity3D-based game and noticed that if the icon of the game is a full-bleed square with NO transparent pixels, it gets some funny green-red-yellow tint when shown in Finder in small size (when viewed in List, Columns or Cover Flow). The icon is displayed fine on Desktop or if the folder is viewed in "as Icons" mode.
If the icon has a transparent frame, no such problem happens. I don't know anything about Mac development and neither googling or searching here brought up anything helpful, but sorry if this is really a basic question. Is it maybe a bug of Finder on Mac? I have 10.7.5 and Mid-2012 13' MacBook Pro.
The issue happens with this icon:
But doesn't happen with this icon:
Make sure the texture you're using as the icon in Unity is set to "Automatic Truecolor." You could be getting artifacts from whatever texture compression you're using on the texture.
I have my macbook pro hooked up to an apple cinema display. I want to work on my code on the laptop but have interface builder on the cinema display. It needs to be this way because my laptop screen doesn't have the resolution to show a full iPad interface layout in IB so I would need to scroll up and down.
The thing I am fighting with is that whenever I open a XIB, or when IB starts, it places any new app windows back on my laptop screen. Is there any way to define a window layout for IB to use, and tell it to start all windows on my second screen by default? Thanks
Unfortunately Interface Builder does not currently save window positions (which include what screen they're on).
You might have limited success using Spaces, which assigns specific applications to specific spaces, but I'm not sure how it would work with multiple screens.