UITableViewCell layoutMargin and separatorInset not "in sync" when in PageSheet - swift

Simple scenario, but the problem is driving me crazy..
What I want to achieve:
UITableViewCell's contentView to be aligned with separatorInset in each and every scenario.
Result: The layoutMargin.left is different from separatorInset when shown in a Popover as page sheet (i.e. iPhone 6/6S Plus) with iOS 8.1-8.2 and iOS 9.x. iOS 8.3 and 8.4 work fine.
Cell Settings:
preservesSuperviewLayoutMargins and contentView.preservesSuperviewLayoutMargins are true
autoLayout of Label is pinned to superView margins with constant 0
Investigations:
If found this post from matt, explaining the underlying problem a bit:
https://stackoverflow.com/a/29712427/844907
I implemented a layoutDidChange method to check the margins:
override func layoutMarginsDidChange() {
debugPrint("layoutMarginsDidChange: ", layoutMargins.left, contentView.layoutMargins.left, separatorInset.left)
}
Some of the returned values after a few rotations from PageSheet to FullScreen:
"layoutMarginsDidChange: " 16.0 16.0 20.0 ("real" popOver on 6+ with 8.2)
"layoutMarginsDidChange: " 20.0 20.0 20.0 (FullScreen 6+ with 8.2)
Or on iPhone 6+ 9.3:
FullScreen (both lines!):
"layoutMarginsDidChange: " 8.0 8.0 20.0
"layoutMarginsDidChange: " 20.0 20.0 20.0
After rotation to pageSheet:
"layoutMarginsDidChange: " 16.0 16.0 20.0
Last value is the separator.left, first two are the layoutMargins.left and contentView.layoutMargins.left.
Any idea how to fix this?
I though of setting layoutMargins.left to separatorInset.left but this doesn't felt right without knowing the source of the problem..
See images below:

Related

body2 is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. - warning message in flutter

If you update flutter SDK from version v1.12.13 to any version after v1.13.8, you will receive several warning messages related to textTheme usage. For example, one of them given below.
info: body2 is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is bodyText1. This feature was deprecated after v1.13.8..
what are the changes in the new version? how to migrate?
What are differences between text theme of material specification 2014 and text theme of material specification 2018?
The TextTheme API was originally based on the original material (2014)
design spec, which used different text style names.
Both values are given below.
The 2018 spec - Text styles
NAME SIZE WEIGHT SPACING
headline1 96.0 light -1.5
headline2 60.0 light -0.5
headline3 48.0 regular 0.0
headline4 34.0 regular 0.25
headline5 24.0 regular 0.0
headline6 20.0 medium 0.15
subtitle1 16.0 regular 0.15
subtitle2 14.0 medium 0.1
body1 16.0 medium 0.5 (bodyText1)
body2 14.0 regular 0.25 (bodyText2)
button 14.0 medium 1.25
caption 12.0 regular 0.4
overline 10.0 regular 1.5
The 2014 spec - Text style
NAME SIZE WEIGHT SPACING 2018 NAME
display4 112.0 thin 0.0 headline1
display3 56.0 normal 0.0 headline2
display2 45.0 normal 0.0 headline3
display1 34.0 normal 0.0 headline4
headline 24.0 normal 0.0 headline5
title 20.0 medium 0.0 headline6
subhead 16.0 normal 0.0 subtitle1
body2 14.0 medium 0.0 body1 (bodyText1)
body1 14.0 normal 0.0 body2 (bodyText2)
caption 12.0 normal 0.0 caption
button 14.0 medium 0.0 button
subtitle 14.0 medium 0.0 subtitle2
overline 10.0 normal 0.0 overline
How to use the new TextTheme attributes? (flutter version v1.13.8 and above)
You can use the desired attribute as shown below.
Theme.of(context).textTheme.headline1
Theme.of(context).textTheme.headline2
Theme.of(context).textTheme.headline3
Theme.of(context).textTheme.headline4
Theme.of(context).textTheme.headline5
Theme.of(context).textTheme.headline6
Theme.of(context).textTheme.subtitle1
Theme.of(context).textTheme.subtitle2
Theme.of(context).textTheme.body1
Theme.of(context).textTheme.body2
Theme.of(context).textTheme.button
Theme.of(context).textTheme.caption
Theme.of(context).textTheme.overline
What are attribute names that does not changed?
Only the following two attribute names are common in both Theme classes.
Theme.of(context).textTheme.caption
Theme.of(context).textTheme.overline

Add Pixel 3 & Pixel 3 XL into custom device settings

I would like to add the new Google phones to the Emulated Devices in Chrome's dev tools.
Does anyone know the correct custom device settings for the Pixel 3 and Pixel 3 XL?
You must enter the viewport size on the google dev center, not screen resolution. So the viewports for pixel 3 and pixel 3 xl are as below.
Pixel 3: 412 x 824 aspect ratio: 16:9 ~ Device pixel ratio: 1.7
Pixel 3 xl: 412 x 847 aspect ratio: 16:9 ~ Device pixel ratio: 1.7
you can use something like this to know you device details :
<!DOCTYPE html>
<html>
<body>
<button onclick="OutputDeviceInfo()">Click me</button>
<p id="width"></p>
<p id="height"></p>
<p id="ratio"></p>
<script>
function OutputDeviceInfo() {
let deviceWidth = window.screen.width;
let deviceHeight = window.screen.height;
let devicePixelAspectRation = window.devicePixelRatio;
document.getElementById("width").innerHTML = deviceWidth;
document.getElementById("height").innerHTML = deviceHeight;
document.getElementById("ratio").innerHTML = devicePixelAspectRation;
console.log('Width: ' + deviceWidth);
console.log('Height: ' + deviceHeight);
console.log('Pixel Ratio: ' + devicePixelAspectRation);
}
</script>
</body>
</html>
Press F12 on Chrome Browser >> Click on toggle device tool bar (on left side small mobile icon) >> click on drop-down option where you can see spme list of devices are there, you can see last option "Edit"- click on that Edit option>> click on "Add custom device" button enter the details for your targets device

API error: <_UIKBCompatInputView: 0x13fd1d7c0; frame = (0 0; 0 0); layer = <CALayer: 0x1c4426e40>> returned 0 width, assuming UIViewNoIntrinsicMetric

I'm using Ionic 3 on iPhone 7 plus with iOS 11. When I run my App, and fill in some text/input fields (basic forms) the app freezes for a few seconds and becomes completely unresponsive (which isn't good, not to say the least). I noticed this error coming up in Xcode, maybe that's the problem. Has anyone else encountered similar errors?
API error: <_UIKBCompatInputView: 0x13fd1d7c0; frame = (0 0; 0 0);
layer = > returned 0 width, assuming
UIViewNoIntrinsicMetric
Remove deprecated items from the forRoot config in app.module.ts
IonicModule.forRoot(),
Eg. remove these:
{
scrollPadding: true,
scrollAssist: false
}
See https://ionicframework.com/docs/utilities/config for more info.

How to fix refreshPreferences Message in Xcode 9 [duplicate]

This question already has answers here:
refreshPreferences HangTracerEnabled / HangTracerDuration messages in iOS 11 + Xcode 9
(3 answers)
Closed 5 years ago.
add this line code to my class
let myLayer = CALayer()
myLayer.contents = self.makeTrySwiftLogoImage().CGImage
var transform = CATransform3DIdentity
transform.m34 = 1.0 / -500
transform = CATransform3DRotate(transform, 45.0f * M_PI / 180.0, 0, 1, 0)
myLayer.transform = transform
and get this message to my console
2017-09-22 18:00:53.354890+0330 SibDiet[973:944502] refreshPreferences: HangTracerEnabled: 0
2017-09-22 18:00:53.355974+0330 SibDiet[973:944502] refreshPreferences: HangTracerDuration: 500
2017-09-22 18:00:53.356014+0330 SibDiet[973:944502] refreshPreferences: ActivationLoggingEnabled: 0 ActivationLoggingTaskedOffByDA:0
and don't run my application, remove this 6 line and run again but receive this message again, remove Xcode and install again but no fix
I managed to fix it on High Sierra(10.13.1) XCode 9.1 and with iOS 11.0.3 by defining OS_ACTIVITY_MODE as disable by going in XCode via
Product > Scheme > Edit Scheme > Arguments > Environment Variables
add OS_ACTIVITY_MODE disable
schema editor (fragment)
Note: NSLog may not work after doing this.
Similar issue is reported in the question:
refreshPreferences HangTracerEnabled / HangTracerDuration messages in iOS 11 + Xcode 9

Android things lcd config

I'm trying to get a 5" LCD working with my raspberry pi 3 and Android Things Developer Preview 4.1.
I've added this to my config.txt:
max_usb_current=1
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0
All I get is a white screen with some artifacts:
It's not a cable issue, I can use the screen with my Windows PC just fine.
I've found some maybe relevant lines in logcat:
01-01 00:00:19.529 412-412/? I/SystemServiceManager: Starting com.android.server.display.DisplayManagerService
01-01 00:00:19.568 412-434/? I/DisplayManagerService: Display device added: DisplayDeviceInfo{"Built-in Screen": uniqueId="local:0", 800 x 480, modeId 1, defaultModeId 1, supportedModes [{id=1, width=800, height=480, fps=60.000004}], colorTransformId 1, defaultColorTransformId 1, supportedColorTransforms [{id=1, colorTransform=0}], HdrCapabilities android.view.Display$HdrCapabilities#192777c, density 160, 160.0 x 160.42105 dpi, appVsyncOff 0, presDeadline 17666666, touch INTERNAL, rotation 0, type BUILT_IN, state UNKNOWN, FLAG_DEFAULT_DISPLAY, FLAG_ROTATES_WITH_CONTENT, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS}
01-01 00:00:19.571 412-434/? I/DisplayManagerService: Display device changed state: "Built-in Screen", ON
01-01 00:00:23.990 412-434/? I/WindowManager: No existing display settings /data/system/display_settings.xml; starting empty
I've bought the screen from an ebay seller. It came with a dvd, and had a sample config.txt file, it suggests the same settings.
What am I doing wrong?