Nativescript: [2.3.0] Image gets covered with color of Page color property

Created on 16 Sep 2016  路  8Comments  路  Source: NativeScript/NativeScript

Platform: iOS
TNS: 2.3.0

If I set this in app.css:

Page {
  background-color: #ffffff;
  color: #ff0000;
}

Then add an Image, with a functional src value. The Image gets covered with the color inherited from the color property of Page. This makes the Image not rendering the image at all, and acts more like a colored box. I feel like this is related to #2649.

bug done android ios

Most helpful comment

Hey @jlooper , @NordlingArt

You can use tns-core-moudles@next where the fix is applied. Once we release a bug0fix I will update the info, Meanwhile use this as a workaround

tns plugin remove tns-core-modules
tns plugin add tns-core-modules@next

All 8 comments

Hey @NordlingArt

I can confirm that this is a bug introduced with N 2.3.0. We are currently working on a fix - I will update the info here once the fix is ready.

Related to https://github.com/NativeScript/NativeScript/issues/2674#issuecomment-247357192

Thanks, this bit me too :)

Hey @jlooper , @NordlingArt

You can use tns-core-moudles@next where the fix is applied. Once we release a bug0fix I will update the info, Meanwhile use this as a workaround

tns plugin remove tns-core-modules
tns plugin add tns-core-modules@next

when i use a next version sometimes images work again, sometimes not, if the image works, suddenly the css styles do not work properly anymore, in all next versions my tabview tabs ignore the tabsColor attribute and color style so i have black tabs with black text-color. I am unable to build a working app now, there is always something broken. when i use the next version like described here, a 2.5 version gets installed where nothing works, no res images, half of the styles are ignored and i have black tabs.
very frustrating.

Is there any CSS workaround we can do to fix this issue in the meanwhile?
I tried doing tns plugin add tns-core-modules@next and my app just doesn't run anymore

Hey @einicher , @viniciodeltoro

Can you provide us with some code samples and error logs in order to investigate your cases? This bug is now fixed and the fix will be released with 2.4.0 in a matter of days, still, if you have problems with @next it will be helpful to log it in a new issues with detailed information which we can use to diagnose your issues.

@NickIliev This is the error that I get when I update the tns-core-modules. If I run my app with the previous version (stable) my app runs properly without showing images.

java.lang.RuntimeException: Unable to resume activity {org.nativescript.gopost/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
Calling js method onCreateView failed

TypeError: Cannot read property 'LayoutParams' of undefined
File: "/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/view.js, line: 507, column: 68

StackTrace:
Frame: function:'ViewStyler.setNativeLayoutParamsProperty', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/view.js', line: 507, column: 69
Frame: function:'StylePropertyChangedHandler.applyProperty', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/styling/style.js', line: 1326, column: 14
Frame: function:'Style._applyStyleProperty', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/styling/style.js', line: 1086, column: 25
Frame: function:'Style._applyProperty', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/styling/style.js', line: 1049, column: 14
Frame: function:'Style._onPropertyChanged', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/styling/style.js', line: 1030, column: 14
Frame: function:'DependencyObservable._setValueInternal', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/dependency-observable.js', line: 307, column: 18
Frame: function:'DependencyObservable._setValue', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/dependency-observable.js', line: 133, column: 14
Frame: function:'onLayoutParamsChanged', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/styling/style.js', line: 130, column: 11
Frame: function:'DependencyObservable._onPropertyChanged', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/dependency-observable.js', line: 213, column: 13
Frame: function:'Style._onPropertyChanged', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/styling/style.js', line: 1028, column: 45
Frame: function:'DependencyObservable._setValueInternal', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/dependency-observable.js', line: 307, column: 18
Frame: function:'DependencyObservable._setValue', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/dependency-observable.js', line: 133, column: 14
Frame: function:'Object.defineProperty.set', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/styling/style.js', line: 856, column: 18
Frame: function:'Object.defineProperty.set', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/view-common.js', line: 527, column: 42
Frame: function:'Page._addViewToNativeVisualTree', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/page/page.js', line: 102, column: 41
Frame: function:'eachChild', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/view.js', line: 160, column: 61
Frame: function:'Page._eachChildView', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/page/page-common.js', line: 286, column: 9
Frame: function:'View._onAttached', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/view.js', line: 165, column: 18
Frame: function:'View._addViewCore', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/view.js', line: 126, column: 18
Frame: function:'View._addView', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/view-common.js', line: 1163, column: 14
Frame: function:'onFragmentShown', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/frame/frame.js', line: 40, column: 11
Frame: function:'FragmentCallbacksImplementation.onCreateView', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/frame/frame.js', line: 612, column: 13
Frame: function:'FragmentClass.onCreateView', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/frame/fragment.js', line: 23, column: 38

at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3400)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3440)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2713)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

Caused by: com.tns.NativeScriptException:
Calling js method onCreateView failed

TypeError: Cannot read property 'LayoutParams' of undefined
File: "/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/view.js, line: 507, column: 68

StackTrace:
Frame: function:'ViewStyler.setNativeLayoutParamsProperty', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/view.js', line: 507, column: 69
Frame: function:'StylePropertyChangedHandler.applyProperty', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/styling/style.js', line: 1326, column: 14
Frame: function:'Style._applyStyleProperty', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/styling/style.js', line: 1086, column: 25
Frame: function:'Style._applyProperty', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/styling/style.js', line: 1049, column: 14
Frame: function:'Style._onPropertyChanged', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/styling/style.js', line: 1030, column: 14
Frame: function:'DependencyObservable._setValueInternal', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/dependency-observable.js', line: 307, column: 18
Frame: function:'DependencyObservable._setValue', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/dependency-observable.js', line: 133, column: 14
Frame: function:'onLayoutParamsChanged', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/styling/style.js', line: 130, column: 11
Frame: function:'DependencyObservable._onPropertyChanged', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/dependency-observable.js', line: 213, column: 13
Frame: function:'Style._onPropertyChanged', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/styling/style.js', line: 1028, column: 45
Frame: function:'DependencyObservable._setValueInternal', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/dependency-observable.js', line: 307, column: 18
Frame: function:'DependencyObservable._setValue', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/dependency-observable.js', line: 133, column: 14
Frame: function:'Object.defineProperty.set', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/styling/style.js', line: 856, column: 18
Frame: function:'Object.defineProperty.set', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/view-common.js', line: 527, column: 42
Frame: function:'Page._addViewToNativeVisualTree', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/page/page.js', line: 102, column: 41
Frame: function:'eachChild', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/view.js', line: 160, column: 61
Frame: function:'Page._eachChildView', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/page/page-common.js', line: 286, column: 9
Frame: function:'View._onAttached', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/view.js', line: 165, column: 18
Frame: function:'View._addViewCore', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/view.js', line: 126, column: 18
Frame: function:'View._addView', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/core/view-common.js', line: 1163, column: 14
Frame: function:'onFragmentShown', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/frame/frame.js', line: 40, column: 11
Frame: function:'FragmentCallbacksImplementation.onCreateView', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/frame/frame.js', line: 612, column: 13
Frame: function:'FragmentClass.onCreateView', file:'/data/data/org.nativescript.gopost/files/app/tns_modules/ui/frame/fragment.js', line: 23, column: 38

at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:865)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:730)
at com.tns.Runtime.callJSMethod(Runtime.java:716)
at com.tns.Runtime.callJSMethod(Runtime.java:697)
at com.tns.Runtime.callJSMethod(Runtime.java:687)
at com.tns.FragmentClass.onCreateView(android.app.Fragment.java)
at android.app.Fragment.performCreateView(Fragment.java:2352)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:995)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171)
at android.app.BackStackRecord.run(BackStackRecord.java:815)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1578)
at android.app.FragmentController.execPendingActions(FragmentController.java:371)
at android.app.Activity.performResume(Activity.java:6790)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3377)
... 10 more

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Pourya8366 picture Pourya8366  路  3Comments

NordlingDev picture NordlingDev  路  3Comments

fmmsilva picture fmmsilva  路  3Comments

kn9ts picture kn9ts  路  3Comments

NickIliev picture NickIliev  路  3Comments