有没有可能强制一个布局以dip为单位具有固定的大小?
可以直接使用View或者使用被强制以dip为单位具有固定大小的布局并将视图放在布局中。
如何实现呢?
android:layout_width="100dp"
你可以两种方式来实现,直接将View放在视图中或将View放在布局中。
是的,这是可能的。您只需要在xml文件中声明视图或布局所需的高度和宽度,如下所示:
android:layout_width="200dip" <!--use this instead of wrap_content or fill_parent-->
android:layout_height="200dip"