Especializa / nativescript-ng-shadow

Angular directive to apply shadows to native elements according to the elevation level guidelines of material design specification
Apache License 2.0
54 stars 38 forks source link

How to have both shadow and borderRadius? #13

Open tempurai opened 6 years ago

tempurai commented 6 years ago

Which platform(s) does your issue occur on?

iOS emulator

Is there any code involved?

<SwipeLayout class="card-container"
     *ngFor="let card of cards"
      (loaded)="swipeLayoutLoaded($event)"
      (swipeLeft)="swipeLeftCallback($event)"
      (swipeRight)="swipeRightCallback($event)"
      [animationState]="swipeLayoutAnimated"
      [gestureMode]="gestureMode">

      <StackLayout width="85%" height="80%" shadow="2">
            <Label></Label>
      </StackLayout>
</SwipeLayout>

basically I wish to have both shadow and border radius on StackLayout. Yet, since they don't work together, I just wondering is there any workarounds?

ghost commented 6 years ago

Have the same problem on Android

<StackLayout *ngFor="let workout of workouts" [ngStyle]="{'background-image': workout.background }" class="workout-box"> <Label [text]="workout.name"></Label> </StackLayout>

The background disapears when I add shadow

MeMartijn commented 6 years ago

I have the same problem.

+1

domzinhuu commented 6 years ago

Hi guys.. you need set bg color in a variable AndroidData or IOSData Exemple:

  btnPrincipalShadow: AndroidData = {
    elevation: 6,
    bgcolor: "#1e3a3d",
    shape: ShapeEnum.OVAL
  };

Here i set elevation level, the bgColor and the shape if you are using border radius use the shape oval.

and then put in your html

[shadow]="btnPrincipalShadow"

vahidvdn commented 6 years ago

+1

suparnavg commented 6 years ago

+1