开发者

Force fading edge on TextView

开发者_如何学PythonI have TextView inside FrameLayout and I want to draw fading edge of FrameLayout over TextView to indicate that text may be expanded vertically. How to draw fading enge of FrameLayout?

Fragment of layout:

<FrameLayout
    android:layout_width="fill_parent" 
    android:layout_height="@dimen/list_item_collapsed"
>
    <TextView
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"
    />
</FrameLayout>


Add fadingEdge and fadingEdgeLength attributes to your TextView definition

<TextView
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"
    android:fadingEdge="vertical"
    android:fadingEdgeLength="@dimen/fadelength"
/>

HINT: Try to avoid using frame layouts where necessary, usually they are not required.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜