Nativescript: CSS linear-gradient doesn't work for ActionBar background

Created on 27 Sep 2018  路  13Comments  路  Source: NativeScript/NativeScript

Did you verify this is a real problem by searching the NativeScript Forum and the other open issues in this repo?

Yes

Tell us about the problem

Setting ActionBar's background to linear-gradient doesn't work.

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:

  • Cross-platform modules: 4.2.x

Please tell us how to recreate the issue in as much detail as possible.

https://play.nativescript.org/?id=MJ30W7&v=3

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

.action-bar {
    background-image: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.2));
}


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

backlog bug in progress ios

Most helpful comment

This issue does have a PR, which was closed due to unresolved issues almost an year ago, we may want to revisit it.

All 13 comments

Here are some samples that use setBackgroundImage, but probably the background-color will need to be mixed in.

https://stackoverflow.com/questions/30884170/how-can-i-set-the-uinavigationbar-with-gradient-color

This doesn't work either with the property "background".

Any updates for this IOS issue?

Any updates on this issue?

@bundyo Any updates or suggestions to get actionbar gradient to work?

Any updates on this?

It would be neat if this could work.

Anyone?? This feature would be greatly appreciated... This works just fine on an android device... but... not at all on an IOS one...

@bundyo
Starting off from where you pointed, I've boiled it down to this
https://gist.github.com/shiv19/1d027194e8d1107c5be20b6382b9b450

you can run this function off of the loaded event on the action bar.
Setting the gradient image outside the setTimeout doesn't work for some reason.

If anyone knows a way to get rid of that setTimeout, please let me know here or in the gist :)

This issue does have a PR, which was closed due to unresolved issues almost an year ago, we may want to revisit it.

@bundyo can you give us any ETA for this please? :)

@shiv19 Hi, thanks first.
I tried the way and to got some problem; the frame size.height not working when I use gradient up to down:
Screen Shot 2020-03-23 at 3 59 07 PM

How can I fix it?

+1
Looking for a solution

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rclai picture rclai  路  52Comments

tjvantoll picture tjvantoll  路  46Comments

tjvantoll picture tjvantoll  路  58Comments

lscown picture lscown  路  58Comments

surdu picture surdu  路  63Comments