Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/fab.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export class Fab extends FloatingActionButtonBase {

if (newImageView !== null) {
// Kill the old Image, cocoapod doesn't support changing it yet
const button = this.nativeView.subviews[0] as MNFloatingActionButton;
const oldBadImageView = button.subviews[0]; // this should be the image view inside the MNFloatingActionButton
const button = this.nativeView.subviews.objectAtIndex(0) as MNFloatingActionButton;
const oldBadImageView = button.subviews.objectAtIndex(0); // this should be the image view inside the MNFloatingActionButton
oldBadImageView.removeFromSuperview();

// Add the new image to the button
Expand Down Expand Up @@ -61,8 +61,8 @@ export class Fab extends FloatingActionButtonBase {
const width = frame.size.width as number;
const height = frame.size.height as number;

const button = this.nativeView.subviews[0] as MNFloatingActionButton;
const imageView = <UIImageView>button.subviews[0]; // should be the image view inside the MNFloatingActionButton
const button = this.nativeView.subviews.objectAtIndex(0) as MNFloatingActionButton;
const imageView = <UIImageView>button.subviews.objectAtIndex(0); // should be the image view inside the MNFloatingActionButton

imageView.contentMode = UIViewContentMode.ScaleAspectFit;
imageView.frame = CGRectMake(0, 0, width / 2, height / 2);
Expand Down