LoginSignup
1
0

More than 3 years have passed since last update.

Androidで特定部分だけ角丸にする

Posted at

shapecornertopLeftRadiusみたいなパラメータがあるので、角丸にしたい部分だけ指定してあげれば角丸になる。以下は上だけ角丸にした場合。

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="@color/white" />
    <corners
        android:topLeftRadius="4dp"
        android:topRightRadius="4dp" />
</shape>

全体角丸はradiusで指定したほうがわかりやすい

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="@color/white" />
    <corners android:radius="4dp" />
</shape>
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0