草庐IT

background-drawable

全部标签

android - SearchView on support.v7.appcompat 库问题 : default 9-patch background not renders properly

我正在使用support.v7.appcompat库开发带有ActionBar的应用程序。操作栏有效,显示SearchView,提示显示。唯一的问题是SearchView的背景没有正确缩放。与往常不同的是,它显得很大,并带有9条黑色线条。使用:从命令行开发,使用antdebug编译。在LinuxMageia3上,ant版本:2013年1月11日编译的ApacheAnt(TM)版本1.8.4使用project.properties行链接到库:android.library.reference.1=../../../../../sdk/extras/android/support/v7/a

android - 为什么drawable文件夹中的文件名不能包含特殊字符或以大写字母开头?

这些规则有意义吗? 最佳答案 文件夹中的每个文件都被翻译成R.java类中的java字段名:drawable\icon.png->R.drawable.icon因此不在文件名中使用特殊字符的原因,因为它们不能在Java名称中使用。至于大写字母,我想这是为了避免在Windows和Linux环境中出现一个小问题。那是因为Linux认为Icon.png和icon.png是不同的文件,而Windows认为Icon.png和icon。png是同一个文件。因此,任何使用Linux的人都可以创建无法在Windows上编译的应用程序。

android - 如何在不调整大小的情况下从流创建 Drawable?

如果我将应用程序的最小目标SDK设置为4,则所有对Drawable.createFromStream的调用都会调整图像大小。例如如果源图像的宽度为480像素,并且运行我的应用程序的Android设备的密度为1.5,则以下代码返回宽度为320的BitmapDrawableURLurl=newURL("http://www.examples.com/something.png");Drawabled=Drawable.createFromStream(url.openStream(),"something.png");是否有一种方法可以强制它不变或指定比例(ldpi/mdpi/hdpi等)

android - 在 build.gradle 中使用 android 支持库 23.2 会使应用程序崩溃(XmlPullParserException : XmlPullParserException: invalid drawable tag vector)

该应用程序在使用支持库v23.1.1插件并在Android4.4.4(API19)下运行时运行良好:compile'com.android.support:appcompat-v7:23.1.1'compile'com.android.support:design:23.1.1'compile'com.android.support:support-v4:23.1.1'然而,当我使用newerversion(23.2)构建它时它崩溃的android支持库:XmlPullParserException:BinaryXMLfileline#17:invaliddrawabletagvect

android - "drawables.xml"目录下的 "values"文件是干什么用的?

对于一个androidstudio项目,我在“values”文件夹中找到了一个名为“drawables.xml”的文件@android:drawable/ic_menu_camera@android:drawable/ic_menu_gallery@android:drawable/ic_menu_slideshow@android:drawable/ic_menu_manage@android:drawable/ic_menu_share@android:drawable/ic_menu_send这个文件的用途是什么?为什么它会创建另一个对现有可绘制对象的引用,为什么不直接使用“@a

android - 如何使用 Compound Drawable 垂直对齐 TextView 中的文本

这个问题在某种程度上是mylastquestion的延续.我现在的问题几乎相同,除了我了解到我可以使用属性android:drawableLeft来设置一个不同View(即ImageView和TextView)中的图像和文本image"for"mytext(Eclipse在LinearLayout行上用警告图标向我指出了这个建议)。我认为唯一的区别是,不是使用setImageResource()方法设置ImageView,而是使用setCompoundDrawablesWithIntrinsicBounds()方法。相反,当我进行更改时,我又回到了原来的问题:文本与View的上边缘而不

安卓工具栏 : how to have a toolbar with image in the background and menu items on top

如何使用MaterialDesign创建带有背景图片的工具栏。下面是我想要的:我正在尝试以下代码:我得到的是: 最佳答案 如果您坚持使用ImageView而不是使用.setBackground(...)函数。您可以尝试使用RelativeLayout和Toolbar覆盖ImageView,如下所示: 关于安卓工具栏:howtohaveatoolbarwithimageinthebackgroundandmenuitemsontop,我们在StackOverflow上找到一个类似的问题:

android - ?安卓 :attr/selectableItemBackground not visible enough on a dark background

在AndroidLollipop上,我使用:android:background="?android:attr/selectableItemBackground"当我点击一个按钮时获得Material动画反馈。当我在白色/浅色布局中包含一个按钮(例如CardView)时,效果很好。但是当我想在深色背景上使用同样的东西时,我们几乎看不到效果,它不够明显。有人有想法吗?谢谢 最佳答案 在API21+上,您可以设置android:theme="@android:style/ThemeOverlay.Material.Dark"在View上

android - 错误 :Failed to resolve: support-vector-drawable

我对gradle有疑问。它工作正常但突然间当我重建项目时它给了我这个错误:Error:Failedtoresolve:support-vector-drawable我无法找出我的问题所在?我的app.gradlebuildscript{repositories{maven{url'https://plugins.gradle.org/m2/'}}dependencies{classpath'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.8.1'}}applyplugin:'com.onesignal.androidsdk.o

android - *有什么*方法可以将 Android/drawable 图形链接到/assets?

我正在尝试支持两个Icon_PickerIntent:org.adw.launcher.icons.ACTION_PICK_ICON和com.betterandroid.launcher2.icons.PICK_ICON_ACTION不幸的是,ADW、GoLauncher和LauncherPro使用上述Intent或使用在/drawable中查找的XML在/drawable中查找可绘制对象而旧的BetterAndroidintent会扫描/assets文件夹中的图像。现在,我知道了用于从XML提供可绘制对象的可绘制对象的绝妙技巧:因此,我没有提供图形,而是指向现有图形-在引用相同图像但