Android学習/drawable
9754 ワード
ダイレクトコードを使用してdrawableを描画する
📎 グラデーションイメージの作成
ツールバーの
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="90"
android:startColor="#E2FFC0"
android:centerColor="#FFF8B7"
android:endColor="#FFC5C1"
/>
</shape>
📎 中心が空の長方形を作成
サンプルコード2479182
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:color="#2196f3"
android:width="30dp"/>
</shape>
📎 前の例では中央の長方形を作成しました
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="#2196f3"/>
<stroke
android:color="@color/white"
android:width="30dp"/>
</shape>
📎 円の長方形を作成
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="#FF9797"/>
<corners
android:bottomLeftRadius="20dp"
android:topLeftRadius="50dp"
android:bottomRightRadius="30dp"
android:topRightRadius="200dp"/>
</shape>
Reference
この問題について(Android学習/drawable), 我々は、より多くの情報をここで見つけました https://velog.io/@yellowsummer/안드로이드-공부-drawableテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol