infix函數作用:將函數調用的語法修改了一下
比如:A to B 等於 A.to(B)
實現方式:在函數前面加上infix即可
限制條件:1.不能是頂層函數;2.參數只能有一個
例子:
infix fun String.beginsWith(p:String) = startsWith(p)
infix函數作用:將函數調用的語法修改了一下
比如:A to B 等於 A.to(B)
實現方式:在函數前面加上infix即可
限制條件:1.不能是頂層函數;2.參數只能有一個
例子:
infix fun String.beginsWith(p:String) = startsWith(p)
this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);