草庐IT

background-clip

全部标签

java - 如何以编程方式设置android :background ="?android:attr/selectableItemBackground"?

如何以编程方式android:background="?android:attr/selectableItemBackground""?我尝试了mView.setBackgroundResource(android.R.attr.selectableItemBackground);但它没有用。 最佳答案 您需要先解析属性。TypedValuetypedValue=newTypedValue();//IusedgetActivity()asifyouwerecallingfromafragment.//Youjustwanttocal

安卓 5.0 : howto change Overview Screen Task Title background color

新的Android5.0LollipopOverviewScreen每个应用程序的任务都带有屏幕截图和(默认情况下)灰色标题栏。一些Lollipop应用程序(例如新的Play商店)使用不同的颜色。如何更改概览屏幕标题背景的颜色? 最佳答案 一般来说,如果你的目标是Material,那么你应该设置colorPrimary(操作栏,最近),colorPrimaryDark(状态栏)和colorAccent(复选框、进度条等)在您的主题中。也就是说,您可以使用以下方法将最近使用的颜色动态更改为其他颜色:TaskDescriptiontas

安卓 : how to know when an app enters or the "background" mode?

我正在尝试通过Android实现以下目标:当应用程序处于后台时,线程会时不时地轮询服务器以检索数据并在有新数据可用时通知用户。我正在为此使用服务,很好。当应用处于“Activity”使用状态时,即其Activity之一可见时,轮询应停止,因为它可能会干扰其他用户操作。我不明白如何检测应用程序“Activity”或“后台”使用之间的转换。onResume()Activity方法似乎没有帮助,因为无论如何在“Activity”使用期间Activity都可以隐藏或可见。我的理解是,应用程序本身并不能区分这两种状态。按下HOME键时可以关联吗?还有其他方法可以区分吗?我正在考虑等效于iPhon

android - 具有表面输入 : Recording in background 的 MediaCodec

我正在开发一个视频编码应用程序,我想防止它在托管Activity进入后台或屏幕循环关闭/打开时停止。我的编码器架构源自优秀的CameraToMpegTest例如,将相机帧显示到GLSurfaceView(参见下面的Github链接)。我目前正在使用双态解决方案进行后台录制:当宿主Activity在前台时,每次调用GLSurfaceView.Renderer的onDrawFrame时编码一个视频帧。这使我可以突发​​访问GLSurfaceView的EGL状态,以免阻塞排队到渲染器线程的其他事件。当托管Activity进入后台时,停止onDrawFrame编码并在循环内的另一个后台线程上对

android - 错误 : app is in background uid null

我在IntelliJCE2017.2上创建了一个新的Android项目并获得了thiserror.我按照答案中的描述添加了Maven部分。当我运行使用新项目创建的默认应用程序时出现错误Errorwhileexecuting:amstartservicecom.test.myapp/com.android.tools.fd.runtime.InstantRunServiceStartingservice:Intent{act=android.intent.action.MAINcat=[android.intent.category.LAUNCHER]cmp=com.test.myapp

android - 使用 Theme.MaterialComponents.Light.NoActionBar 样式时,设置 Button Background 无效

为了使用Chip和ChipGroup,我设置了ApplicationstyleextendsTheme.MaterialComponents.Light.NoActionBarintmanifests.xml,然后我设置了Button"android:background"属性,但它没有影响!为什么?我能做什么?这是我的风格:@color/primary_material_light@color/header_color48dpportrait@style/AntButton-->@style/AntButton-->-->@color/ffc000-->@color/ffc000@d

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

安卓工具栏 : 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 - 更改按钮android :background to different drawable

我是Android和Java的新手,但我已经设法自学并在stackoverflow上找到了大多数问题的答案,而无需提出问题。直到现在....在这里,我有许多彩色按钮,单击它们时,颜色会更改为一系列不同的颜色。有许多按钮被定义为例如:有人可以告诉我如何使用代码更改android:background以将上面的示例更改为黄色,例如,当单击按钮时。在下面的代码中,clickedButton是我需要更改背景的按钮的ID。publicvoidonClick(Viewv){intid=v.getId();StringclickedButton=getResources().getResourceE