- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 android 中有一个布局,它有两个 ImageView 。我在不同屏幕的相应可绘制文件夹中为此提供了图像。这种布局在手机上看起来不错,但在平板电脑上,图像看起来并没有填满整个可用空间。
即使我改变图像的大小图像看起来一样,也看不到任何变化。所以在平板电脑中,图像会以某种方式缩小。我不知道我做错了什么。
这是我的布局
<?xml version="1.0" encoding="utf-8"?>
<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/background" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/player_score"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="@string/you"
android:textColor="@color/text"
android:textSize="40sp" />
<TextView
android:id="@+id/com_score"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:gravity="right"
android:text="@string/com"
android:textColor="@color/text"
android:textSize="40sp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/com_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_horizontal"
android:contentDescription="@string/image_desc"
android:paddingTop="0dp"
/>
<TextView
android:id="@+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/ready"
android:textColor="@color/text"
android:textSize="50sp" />
<ImageView
android:id="@+id/player_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_horizontal"
android:contentDescription="@string/image_desc"
android:paddingTop="0dp"
android:paddingBottom="0dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/rock"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/button"
android:textColor="@color/text"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="@string/rock"/>
<View
android:layout_width="2dp"
android:layout_height="match_parent"
android:background="@color/text"/>
<Button
android:id="@+id/paper"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/button"
android:textColor="@color/text"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="@string/paper"/>
<View
android:layout_width="2dp"
android:layout_height="match_parent"
android:background="@color/text"/>
<Button
android:id="@+id/scissors"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/button"
android:textColor="@color/text"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="@string/scissors"/>
</LinearLayout>
</LinearLayout>
最佳答案
我认为你可以:
ImagesView
的 layout_width
更改为 match_parent
android:adjustViewBounds="true"
(也添加到 ImageView
)关于Android ImageView 大小在平板电脑中没有改变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26655133/
我正在尝试从 Linux 远程登录到 Windows PC,但显示错误“登录失败”。 这是我的 Python 脚本。我正在使用 pexpect 模块。我也尝试过使用 telnetlib 但同样的错误:
大多人在windows平台用的tomcat都是免安装版本的,很自然想到复制几份目录,就是在同一个电脑上跑多个tomcat服务了。实际上是不可以的。经过如下方法就可以实现统一台服务器(电脑)上运行多个
正负号是一个不常用的符号,很多小伙伴不知道怎么打出来,打出来确实有点麻烦,很多小伙伴不知道怎么弄,今天小编就给大家带来了轻松便捷的方法吧。 正负号怎么打出来 方法1、“&plu
在一项作业中,我被要求创建一个 [7] x [7] 矩阵,以及一个与计算机对战的井字棋游戏。玩家是 X,计算机是 O。[1][1] 是选择 1,[1][3] 是选择 2,[1][5] 是选择 3,[3
我想知道如何开发应用程序/服务器。我的安卓手机会在我说话时录制我的声音,并将其发送到 PC,然后使用 PC 的扬声器播放。 我想我需要一个在计算机上运行的媒体服务器来接收我的声音,然后使用手机上已有的
我正在开发一个使用蓝牙玩的安卓游戏应用程序。在搜索蓝牙设备时,结果包含移动设备和 mac pc/笔记本电脑。我只想在结果列表中列出移动设备。是否可以确定检测到的设备是否为移动设备? 最佳答案 当你有
在学习 Meteor 框架的过程中,我正在将 Yik Yak 移动应用程序重新创建为 Web 应用程序。但该应用程序是完全匿名的,没有用户帐户,但您仍然只能对帖子投赞成票或反对票一次。如何做到这一点?
我花了一些时间寻找解决方案。我已经使用 MacPorts 在我的 mac 上重新安装了 Vim 好几次。 vim --version 命令显示 +clipboard 和 +xterm_clipboar
我是一名优秀的程序员,十分优秀!