一:
LinearLayout
RelativeLayout
二:
ListView
GridView
例子:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<TextView
android:id="@+id/textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="the first textview"/>
<TextView
android:id="@+id/textview2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="the second textview"/>
</LinearLayout>

注意此时第二个控件就被挤出屏幕外了
px/dpi/dp/ps 概念
px 像素
dpi 每英寸含像素个数
dip(dp)与设备无关像素
sp

控件内容与控件边缘的边距叫内边距
控件边缘与其他控件的距离叫外边距

最后
以上就是洁净唇彩最近收集整理的关于Android(4)布局方法、px/dp/dpi/ps/内边距与外边距的全部内容,更多相关Android(4)布局方法、px/dp/dpi/ps/内边距与外边距内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复