Skip to content

Commit bcc8cb2

Browse files
authored
Update README.md
1 parent a1d2e96 commit bcc8cb2

1 file changed

Lines changed: 41 additions & 38 deletions

File tree

README.md

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,45 +12,48 @@ TV常用效果控件,包括焦点、边框处理等。qq群:537960195
1212
<img src="https://github.com/evilbinary/TvWidget/raw/master/data/demo1.gif" alt="界面" style="max-width:800px;" width="420px" />
1313

1414
# 使用
15+
```java
16+
//基本用法
17+
BorderView border=new BorderView(this);
18+
border.setBackgroundResource(R.drawable.item_highlight);
19+
RelativeLayout main= (RelativeLayout) findViewById(R.id.main);
20+
border.attachTo(main);
21+
22+
//自定义布局
23+
BorderView borderView = new BorderView<RelativeLayout>(this,R.layout.custom_item);
24+
25+
//设置放大倍数1.2
26+
borderView.getEffect().setScale(1.2);
27+
```
28+
```xml
29+
//圆角布局 app:radius 为圆角大小
30+
<org.evilbinary.tv.widget.RoundedFrameLayout
31+
android:id="@+id/view"
32+
android:layout_width="270dp"
33+
android:layout_height="406dp"
34+
android:layout_margin="5dp"
35+
android:focusable="true"
36+
app:radius="4dp"
37+
>
38+
<ImageView
39+
android:layout_width="match_parent"
40+
android:layout_height="match_parent"
41+
android:scaleType="centerCrop"
42+
android:src="@drawable/g2"
43+
/>
44+
<TextView
45+
android:layout_width="match_parent"
46+
android:layout_height="60dp"
47+
android:layout_gravity="bottom"
48+
android:background="@drawable/border_down_shape"
49+
android:gravity="center|left"
50+
android:padding="15px"
51+
android:text="在线音乐"
52+
android:textColor="@color/white"
53+
android:textSize="24dp" />
54+
</org.evilbinary.tv.widget.RoundedFrameLayout>
55+
```
1556

16-
//基本用法
17-
BorderView border=new BorderView(this);
18-
border.setBackgroundResource(R.drawable.item_highlight);
19-
RelativeLayout main= (RelativeLayout) findViewById(R.id.main);
20-
border.attachTo(main);
21-
22-
//自定义布局
23-
BorderView borderView = new BorderView<RelativeLayout>(this,R.layout.custom_item);
24-
//设置放大倍数1.2
25-
borderView.getEffect().setScale(1.2);
26-
27-
//圆角布局 app:radius 为圆角大小
28-
<org.evilbinary.tv.widget.RoundedFrameLayout
29-
android:id="@+id/view"
30-
android:layout_width="270dp"
31-
android:layout_height="406dp"
32-
android:layout_margin="5dp"
33-
android:focusable="true"
34-
app:radius="4dp"
35-
>
36-
<ImageView
37-
android:layout_width="match_parent"
38-
android:layout_height="match_parent"
39-
android:scaleType="centerCrop"
40-
android:src="@drawable/g2"
41-
/>
42-
<TextView
43-
android:layout_width="match_parent"
44-
android:layout_height="60dp"
45-
android:layout_gravity="bottom"
46-
android:background="@drawable/border_down_shape"
47-
android:gravity="center|left"
48-
android:padding="15px"
49-
android:text="在线音乐"
50-
android:textColor="@color/white"
51-
android:textSize="24dp" />
52-
</org.evilbinary.tv.widget.RoundedFrameLayout>
53-
5457
#项目捐赠
5558

5659
![喜欢就支持一下](https://github.com/evilbinary/myblog/raw/master/data/s.png)

0 commit comments

Comments
 (0)