網頁

2020年7月13日 星期一

IE11中使用flex + min-height做垂直置中的問題

前端的人使用bootstrap4切版,套版後覺得不好看,臨時改成有有最小高度,結果發現在IE無法垂直置中,查半天跟flex有關的資料,看到internet-explorer - 在 IE 中,css Flexbox不是垂直居中提到height要設定因為ie的bug,實際設定height設個比min-height小的值,就真的垂直置中了,真的太神奇了 @@

PS. 不確定是否全部ie版本都能用,但ie11可行。

--- 7/16 更新
傻傻的以為能用,這做法不適合高度會變動的版面

參考網址:
internet-explorer - 在 IE 中,css Flexbox不是垂直居中

2020年3月15日 星期日

Xcode 10.1編譯舊專案出現了'sqlite3_key' is invalid in C99的Error

依然是舊專案的問題,出現了'sqlite3_key' is invalid in C99的Error,查了下看到這篇sqlite3_key is invalid in C99 iOS11,看起來在iOS10是正常的,仔細想了下猜測是compiler版本問題,我的Xcode是10.1,就回到Xcode -> Preferences,點擊Locations,找到Command Line Tools,選Xcode 8.3.1,重開再compiler就OK了

參考網址:
sqlite3_key is invalid in C99 iOS11

升級到Xcode 9.3後出現Expected method to read dictionary element not found on object of type 'id'

開啟多年未開的專案想要compile時一直出現Expected method to read dictionary element not found on object of type 'id<NSFastEnumeration,NSObject>'的錯誤訊息,仔細查看,是PromiseKit這個library在xcode 9.3後會有的問題,查半天都是講用cocoapods升級PromiseKit到1.7.2就OK了,打下pod update後,又出現其他專案的Error,仔細一看發現一個根本不能update的Library,問題最後只能是直接解決這error,反過來想,只好去查看這Framework針對這issue的commit,最後找到Fix build on Xcode 9.3,修改如下



有種怎沒想到這樣改的蠢想法,不過又有種這像是workaround的感覺!!

參考網址:
Objective C- Xcode 9.3 - Expected method to read dictionary element not found on object of type
Fix build on Xcode 9.3

2020年1月30日 星期四

Laravel指定版本建立專案

Laravel的版本更新蠻快的,但主機的PHP常都在舊些的版本,例如沒指定版本都用到Laravel framework 6.X及PHP 7.2,但我還在用PHP 7.1,最新支援版本是5.8.35,所以在建立是要用以下的指令,demo是專案名,這樣即可。這邊做個筆記。

composer create-project laravel/laravel=5.8.* demo

參考網址:
Installing specific laravel version with composer create-project

2020年1月14日 星期二

ScrollView內設定自動計算出高度的Content

參考:http://adad184.com/2014/09/28/use-masonry-to-quick-solve-autolayout/
4. [中级] 在UIScrollView顺序排列一些view并自动计算contentSize

參考網址:
http://adad184.com/2014/09/28/use-masonry-to-quick-solve-autolayout/