Help us understand the problem. What is going on with this article?

4.0.x系でTextViewでBorder指定して黒塗りされた時の対処

More than 3 years have passed since last update.
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <stroke android:width="1dp" android:color="@color/base_gray" />
</shape>
<TextView
    android:background="@drawable/base_gray_border"
    android:gravity="center"
    android:text="テスト"
    android:textSize="18sp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

Borderを指定しようとして、こんなBorderだけ指定するファイルを書いた
1dpで@color/base_grayの色で塗られたボーダーがTextViewに着くはずだった・・・

5系だとBorderだけ表示されていたが、4.0系だとTextViewの中が黒塗りに!
Styleの関係とか・・・?

<?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" />
    <stroke android:width="1dp" android:color="@color/base_gray" />
</shape>

solidで背景色も指定して黒塗りはなおりました。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした