Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经在 android 应用程序上创建了。我在这个项目上使用了一些按钮和图像,我的问题是,
我不知道如何提及我的 android 项目中以下文件夹的每个按钮和图像的大小。
可绘制-> 可绘制-hdpi 可绘制-mdpi 可绘制-xhdpi 可绘制-ldpi
** 如果我为每个文件夹使用相同大小的按钮和图像,我的应用程序布局不合适。为什么?是否有任何标准方式提及按钮和图像的尺寸?
请提出建议
感谢您宝贵的时间!..
<Button android:id="@+id/button" android:layout_width="50dp" android:layout_height="25dp" android:gravity="center" android:text="Button" android:textSize="12dp"/>
只需在您的 xml 中给出 layout_width、layout_height 值。并遵循相同的 ImageView 也
尝试将按钮的背景创建为九个补丁图像,然后将它们放在可绘制文件夹中。
关于支持不同的屏幕尝试阅读这个