草庐IT

target_height

全部标签

android:layout_height ="?attr/actionBarSize"不适用于 support:design:23.0.0' 库

如果我设置android:layout_height="56dp",我可以在图形布局中看到工具栏。但是当我像下面这样设置时,工具栏未在图形布局中显示。Studio说attr/actionBarSize被标记为私有(private)。我正在使用compile'com.android.support:appcompat-v7:23.0.0'compile'com.android.support:design:23.0.0'可能是什么问题?我该如何解决它!是的,Studio已更新。 最佳答案 使用?android:attr/actionB

android - Cordova ubuntu : An error occurred while listing Android targets

我正在尝试将android平台添加到我的cordova项目中,但出现错误:$cordovaplatformaddandroid-dcordovalibraryfor"android"alreadyexists.Noneedtodownload.Continuing.Checkingifplatform"android"passesminimumrequirements...CheckingAndroidrequirements...cordovalibraryfor"android"alreadyexists.Noneedtodownload.Continuing.Error:Aner

android - Cordova ubuntu : An error occurred while listing Android targets

我正在尝试将android平台添加到我的cordova项目中,但出现错误:$cordovaplatformaddandroid-dcordovalibraryfor"android"alreadyexists.Noneedtodownload.Continuing.Checkingifplatform"android"passesminimumrequirements...CheckingAndroidrequirements...cordovalibraryfor"android"alreadyexists.Noneedtodownload.Continuing.Error:Aner

android - android :scaleType ="fitCenter" only work with fix Layout_width and Layout_height attributes?

我使用Layout_width="fill_parent"和Layout_height="wrapcontent"。如果图像比ImageView大,它将被完美地缩小。但是,我从来没有使用它来放大较小的图像。我尝试了ScaleType的任意组合和“AdjustViewBounds”:它总是在ImageView的中间保持自己的大小。这是代码... 最佳答案 我刚刚找到了让它工作的方法。这适用于2.1(AVD)和4.1.2(设备) 关于android-android:scaleType="fi

android - android :scaleType ="fitCenter" only work with fix Layout_width and Layout_height attributes?

我使用Layout_width="fill_parent"和Layout_height="wrapcontent"。如果图像比ImageView大,它将被完美地缩小。但是,我从来没有使用它来放大较小的图像。我尝试了ScaleType的任意组合和“AdjustViewBounds”:它总是在ImageView的中间保持自己的大小。这是代码... 最佳答案 我刚刚找到了让它工作的方法。这适用于2.1(AVD)和4.1.2(设备) 关于android-android:scaleType="fi

报错解决_Android_waiting for all target devices to come online

安卓报错——waitingforalltargetdevicestocomeonline最近在搞安卓实验,不知道为啥,昨天还好好地,今天一开机就这样,找了很多方式,自己也试了很多,以下是我尝试成功的方法。1、关闭模拟器首先,我们先关闭“模拟器”。如果不关闭就会出现,以下这种情况。弹出窗口:设备已经运行了,请去删除一个很长文件夹中的文件。此时,你要冷静,你不要傻着去删除那个文件,其实这个问题就仅仅是你的设备已经运行了,这个问题的原因就是你的模拟器已经打开了,现在重复打开了,当然会出现提示,这个设备已经运行了。所以,解决方式就是将之前的那个模拟器先关闭,然后再打开一个新的模拟器就好了。2、找到De

android:layout_height 屏幕大小的 50%

我刚刚在LinearLayout中实现了一个ListView,但我需要定义LinearLayout的高度(它必须是屏幕高度的50%)。这可能吗?我为按钮和EditText做了类似的事情,但似乎不适用于布局。这是我的代码://capturethesizeofthedevicesscreenDisplaydisplay=getWindowManager().getDefaultDisplay();doublewidth=display.getWidth();//myEditTextwillbesmallerthanfullscreen(80%)doubledoubleSize=(width

android:layout_height 屏幕大小的 50%

我刚刚在LinearLayout中实现了一个ListView,但我需要定义LinearLayout的高度(它必须是屏幕高度的50%)。这可能吗?我为按钮和EditText做了类似的事情,但似乎不适用于布局。这是我的代码://capturethesizeofthedevicesscreenDisplaydisplay=getWindowManager().getDefaultDisplay();doublewidth=display.getWidth();//myEditTextwillbesmallerthanfullscreen(80%)doubledoubleSize=(width

android - 具有layout_height ="wrap_content"的android XML布局中的ImageView具有顶部和底部填充

我有一个包含ImageView和一些其他布局和View的垂直LinearLayout。我的问题是,当显示Activity时,ImageView在顶部和底部有一个填充。我已经确认它是ImageView(通过在ImageView上设置背景颜色)。图片为450x450像素。手动将高度设置为450px会产生所需的效果(无填充),将其设置为450dp会产生与使用wrap_content相同的效果。似乎android正在获取图像的高度(450px)并将ImageView的高度设置为相同的值,但是在dp中。关于我能做些什么来解决这个问题有什么想法吗?我不想使用绝对值,因为我将为不同的屏幕密度提供不同

android - 具有layout_height ="wrap_content"的android XML布局中的ImageView具有顶部和底部填充

我有一个包含ImageView和一些其他布局和View的垂直LinearLayout。我的问题是,当显示Activity时,ImageView在顶部和底部有一个填充。我已经确认它是ImageView(通过在ImageView上设置背景颜色)。图片为450x450像素。手动将高度设置为450px会产生所需的效果(无填充),将其设置为450dp会产生与使用wrap_content相同的效果。似乎android正在获取图像的高度(450px)并将ImageView的高度设置为相同的值,但是在dp中。关于我能做些什么来解决这个问题有什么想法吗?我不想使用绝对值,因为我将为不同的屏幕密度提供不同