工作筆記1

1.  判斷一個String是否爲空時候,string.length > 1 比string != "" 好用~原因不知~~反正用length解決了~


2, android:fillViewport="true" on theScrollView.  scrollview  必須要設置這個爲true,才能擴展內部的部件顯示出來


3,  點擊textview,展開更多內容的方法。

Actually, the way android platform does that is by setting the MaxLine to Integer.MAX_VALUE.

textView.setMaxLines(Integer.MAX_VALUE);

also, if you are using Ellipsize, don't forget to set to null.

textView.setEllipsize(null);

just check how the android framework do just that ;) watch the setMaxLines(Integer.MAX_VALUE);

private void applySingleLine(boolean singleLine, boolean applyTransformation) {
    mSingleLine = singleLine;
    if (singleLine) {
        setLines(1);
        setHorizontallyScrolling(true);
        if (applyTransformation) {
            setTransformationMethod(SingleLineTransformationMethod.getInstance());
        }
       } else {
            setMaxLines(Integer.MAX_VALUE);
            setHorizontallyScrolling(false);
            if (applyTransformation) {
                 setTransformationMethod(null);
        }
       }
     }


4, 

setEllipsize
這個是內容過長加省略號的作用~

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章