同一个layout,在三星的galaxy tab p100(7寸,1024x600)显示的内容还是正常的(大小合适)。为什么在现代的H900(8寸,1024x768),内容都显示得很小呢?基本是P100显示的内容大小只有在H900里的一半。
解决方案 »
- 使用aChartEngineer没有图像显示
- android不允许复制粘贴内容进密码框怎么实现?
- 求repo。repo,repo....
- android系统是用什么语言开发的,开发android的软件又要用什么语言
- Java, JVM and Process问题
- 关于两个互相交互的activity的生命周期问题
- ListView 显示网络图片
- scrollview下listview中的textview显示多行时,无法显示,
- 手贱更新SDK到23.0.2
- 关于蒲公英 平台上 部分三星华为 无法下载安装的问题
- 问一个android doc的问题,熟悉的应该都能给提一点意见。
- 如何监听Android GPS设备的搜索卫星状态和稳定接收卫星数据状态?
布局填充满应该不会有这样的问题吧!
也有可能你里面的图片大小是600的啊那样的话就少了
在布局里面用
android:layout_width="fill_parent"
android:layout_height="fill_parent"
估计就不会有你这样的问题了!
如果要适配多种分辨率的话还建议用dip,根据你的屏幕大小设置比例而不是绝对的像素点
2, android:layout_width="fill_parent"
android:layout_height="fill_parent"
3, 最好使用dip
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/activitybg" > <LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/toolbarbg_above"> <Button
android:id="@+id/buttonHome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_home"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp"
android:text="" />
<TextView
android:id="@+id/titelView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/textViewStyle.Title"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="test1" />
</LinearLayout> <LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/toolbarbg_center" >
<TextView
android:id="@+id/optView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
style="@style/textViewStyle.Title2"
android:text="test2" />
<ImageView
android:id="@+id/imageViewProgress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:src="@drawable/processbarbg_01" />
</LinearLayout>
<MyViewGroup
android:id="@+id/viewGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"></MyViewGroup>
<LinearLayout
android:id="@+id/linearLayout4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="horizontal" >
<Button
android:id="@+id/prevButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginBottom="5dp"
style="@style/buttonStyle"
android:text="上一步" /> <Button
android:id="@+id/nextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginBottom="5dp"
style="@style/buttonStyle"
android:text="下一步" />
</LinearLayout>
</LinearLayout>
比如里面的工具票背景图片(processbarbg_01),在三星的机子中就是挺OK的,在HY的机子就显得很小,但实际上这两种设备的分辨率相差不大呀
android:id="@+id/imageViewProgress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:src="@drawable/processbarbg_01" />
这个尺寸不能设成wrap_content,
你可以找到 processbarbg_01 对应的图片看它是多少像素的,
假设那图片是 90*75 px 的,
那么就要把图片的尺寸设为 (90/1.5)*(75/1.5) dp 的就是 60*50 dp
android:layout_width="60dp"
android:layout_height="50dp"