您的位置:首页 > 其它

带动画效果的简单Tips显示

2015-06-30 00:00 295 查看
摘要: SuperToolTips 是一个根据触发位置显示提示条的控件。

https://github.com/nhaarman/supertooltips

介绍:

SuperToolTips 是一个根据触发位置显示提示条的控件。

运行效果:



使用说明:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32
<RelativeLayout

xmlns:android="
http://schemas.android.com/apk/res/android"

android:layout_width="match_parent"

android:layout_height="match_parent">

<TextView

android:id="@+id/activity_main_redtv"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_centerInParent="true" />

<com.nhaarman.supertooltips.ToolTipRelativeLayout

android:id="@+id/activity_main_tooltipRelativeLayout"

android:layout_width="match_parent"

android:layout_height="match_parent" />

</RelativeLayout>

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

ToolTipRelativeLayout toolTipRelativeLayout = (ToolTipRelativeLayout) findViewById(R.id.activity_main_tooltipRelativeLayout);

ToolTip toolTip = new ToolTip()

.withText("A beautiful View")

.withColor(Color.RED)

.withShadow()

.withAnimationType(ToolTip.ANIMATIONTYPE_FROMTOP);

myToolTipView = toolTipRelativeLayout.showToolTipForView(toolTip, findViewById(R.id.activity_main_redtv));

myToolTipView.setOnToolTipViewClickedListener(MainActivity.this);

}

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: