Skip to content

[2.3.0] Image gets covered with color of Page color property #2733

Closed

Description

@NordlingDev

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.

Activity

  1. changed the title [-][2.3.0] Image gets covered color of Page color property[/-] [+][2.3.0] Image gets covered with color of Page color property[/+] on Sep 16, 2016
  2. NickIliev commented on Sep 16, 2016

    @NickIliev
    Contributor

    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 #2674 (comment)

  3. jlooper commented on Sep 17, 2016

    @jlooper

    Thanks, this bit me too :)

  4. NickIliev commented on Sep 17, 2016

    @NickIliev
    Contributor

    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
    
  5. added this to the 2.4.0 milestone on Sep 17, 2016
  6. added
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    on Sep 17, 2016
  7. added and removed
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    on Oct 27, 2016
  8. viniciodeltoro commented on Nov 4, 2016

    @viniciodeltoro

    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

  9. NickIliev commented on Nov 4, 2016

    @NickIliev
    Contributor

    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.

  10. viniciodeltoro commented on Nov 5, 2016

    @viniciodeltoro

    @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
    
  11. lock commented on Aug 29, 2019

    @lock

    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.

  12. locked and limited conversation to collaborators on Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions