Created
December 14, 2013 17:09
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- 作った shape を元に clip を作る --> | |
<clip xmlns:android="http://schemas.android.com/apk/res/android" | |
android:clipOrientation="vertical" | |
android:drawable="@drawable/shape_oval_text_background" | |
android:gravity="bottom|clip_vertical" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- TextView の背景に clip を指定 --> | |
<TextView | |
android:id="@+id/text_view" | |
android:layout_width="300dp" | |
android:layout_height="300dp" | |
android:layout_centerInParent="true" | |
android:background="@drawable/clip_text_background" | |
android:gravity="bottom|center_horizontal" | |
android:paddingBottom="30dp" | |
android:text="@string/hello_world" | |
android:textColor="#FF0000" | |
android:textSize="22sp" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ClipDrawable を持ってきてレベルを指定 | |
TextView textView = (TextView) this.findViewById(R.id.text_view); | |
ClipDrawable background = (ClipDrawable) textView.getBackground(); | |
background.setLevel(background.getLevel() + 2500); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- 円形の shape を作る --> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="oval" > | |
<solid android:color="#8000FF00" /> | |
<stroke | |
android:width="5dp" /> | |
</shape> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment