LoginSignup
4
6

More than 5 years have passed since last update.

Android Studio3.0を勉強していてdimen.xmlがなくてハマった

Last updated at Posted at 2017-11-28

dimen.xmlがない。

Android2.x系の参考書で勉強してたら出てきた。
res > valuesの直下に作成するらしい。ふーん。

dimen.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <dimen name="activity_horizontal_margin">25sp</dimen>
</resources>

これで他のlayout.xmlから参照できる。参照するときは
android:paddingBottom="@dimen/activity_horizontal_margin"
みたいに書くとよい。

4
6
1

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
4
6