Shadows appear inside uiimageview [closed] - swift

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am designing the asets to the app in Sketch. I want to use Shadows, and quite a lot of spread. However, the problem is that when I am exporting the assets into my iOS project in Xcode the image view needs to be a lot larger in order for the shadows to exsists.
The problem is that I'm working with a collection view and that means that there is a huge spacing in-between the cells.
Any idea how this could be solved?

You can take your image without shadow and apply shadow using code. you can add shadow to UIIamgeView.
<imageview>.layer.shadowColor = UIColor.tabGrayColor.cgColor
<imageview>.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
<imageview>.layer.shadowRadius = 5
<imageview>.layer.shadowOpacity = 0.7
<imageview>.layer.masksToBounds = false
You can play around shadowRadius to get desired spread.

Related

Unity2D Simulating height with Top Down Shadows [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
So the problem is the following:
I have been trying to make this flying simulator little phone game, the problem is i cant make the shadow change with a smooth transition...
That White squared is a cloud, and the objective is to have the shadow change size while in the cloud...
I don´t really know were to start, i tried shaders, but i´m not that good with that...
Thx :))
If you are not into shaders, I would look into Masks. Masks basically limit a sprite to only draw within it's boundaries.
In this example, you could have a mask on the cloud. To make it work, have the "nearer" shadow be always drawn, but only in the mask's boundaries (In this case - the cloud) Relevant Youtube Tutorial

Detect if face is within a circle [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Currently I am working on face detection app. I have implemented face detection part using Apple's Vision.
And app has custom white circle drawn over the screen (you can see in below image).
Now, how can I detect if face is within that custom white circle or not?
I have also done similar project for fun. Link here: https://github.com/sawin0/FaceDetection
For those who don't want to dive into repo.
I have quick suggestion for you, if you have path of circle and face as CGPath then you can compare circle's and face's bounding box using contains(_:using:transform:) .
Here is a code snippet
let circleBox = circleCGPath.boundingBox
let faceBox = faceRectanglePath.boundingBox
if(circleBox.contains(faceBox)){
print("face is inside the circle")
}else{
print("face is outside the circle")
}
I hope this helps you and others too.
P.S. If there is any better way to do this then please feel free to share.

SceneKit - Xcode 9: removing the box's line border [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am new to SceneKit, currently playing around with it.
I use 4 boxes as walls to create a sort of skybox.
Each box/wall has its own starfield texture. Currently this causes the borders of the walls to be visible. I want to remove these line borders, any idea?
That is a result of the texture you use, which is not seamless. Look into "seamless tileable" textures. A much better approach to do what you are trying to do however, is to use the scene’s background property as explained in the answer of this question: How to set contents of scenekit background to cube map

Problems with UI Button Settings & Locations [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have custom buttons which I need to be placed in certain areas when I setup them up via a template i have on PS they look pixel perfect but the when I run it it looks like crap. I have the right sizes and the right x,y coordinates set up in the attributes section? is there any way to not have a status bar at all or some way to get pixel perfect measurements?
Try This
btnObje.frame = CGRectMake(x,y,image.frame.size.width,image.frame.size.height);

Which one will be more efficient for shadow effect behind toolbar? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I am writing an app on iOS platform, I want a shadow effect behind my toolbar like this,
Currently I am using UIImageView for a start up, However I would like to know which one would be better choice? Using UIImageView or drawing a rectangle with gradient in it?
Thanks for any inout!
Is there going to be animated content overlapping your shadow? Because unless there is, I doubt it makes enough of a difference to matter. In which case, go with UIImageView, because it's easiest.
If there is going to be animated content, I would suspect you'll be able to wring slightly better performance out of drawing it yourself, but you're going to have to do some Core Graphics optimization (cache the drawn gradient, cache the CGGradient for redraws, etc.).
Beware premature optimization. BEWARE!