Skip to content

Instantly share code, notes, and snippets.

View ravanar-sk's full-sized avatar
🎯
Focusing

Saravana Kumar K R ravanar-sk

🎯
Focusing
View GitHub Profile
@susanstevens
susanstevens / iphone-popover.md
Last active September 8, 2023 02:25
How to Create a Popover on iPhone

How to Create a Popover on iPhone

Storyboard set up

Add your view controllers in storyboard. In the Size Inspector, change the simulated size of the popover view controller to "Freeform". This doesn't change the popover's size when you run the app, but it does make it easier to lay out subviews correctly.

storyboard

When adding the segue between view controllers, select "Present as Popover".

@sunwicked
sunwicked / CustomLayoutManager.java
Created November 4, 2017 15:06
Custom LinearLayoutManager for scaling, fading and snapping children to top
class CustomLayoutManager extends LinearLayoutManager {
private final float mShrinkAmount = 0.15f;
private final float mShrinkDistance = 0.9f;
Context mContext;
//Make an instance variable at the top of you LayoutManager
private static final float MILLISECONDS_PER_INCH = 50f;
public CustomLayoutManager(Context context) {
super(context);
mContext = context;