小编Ale*_*qui的帖子

在ActionBar的主页图标和标题之间填充

有人知道如何在ActionBar的主页图标和标题之间设置填充吗?

android android-actionbar

107
推荐指数
8
解决办法
10万
查看次数

Android促销代码

我试图向一些用户提供一些促销代码,但我刚刚意识到Android Market没有这个功能,如图所示

在这里:https://groups.google.com/a/googleproductforums.com/forum/#!category_topic/android-market/appy-talk-all-about-apps/2m8zvqr_HTo

在这里:https://groups.google.com/a/googleproductforums.com/forum/#!category-topic/android-market/feature-requests--suggestions/3Spa5KuMgF4

有些人将网站命名为http://www.twirkz.com/,作为提供促销代码的解决方法.我的问题是:它可靠吗?我知道从那里安装的人不会收到来自Android Market的任何更新,但除此之外还有其他问题吗?

如果您有任何人知道从我的付费应用程序提供一些免费应用程序的替代方法,我将不胜感激.

android google-play

17
推荐指数
2
解决办法
2万
查看次数

Android - 递归删除布局中的视图

有没有办法从递归中删除布局中的视图?函数removeAllViewsInLayout()似乎不执行任务(它从布局中删除所有视图,但不删除布局的子视图).在我的程序中,我在RelativeLayout上动态添加了一些FrameLayouts,并在这些FrameLayouts上添加了一些ImageViews和TextViews.所以我想知道我是否必须制作自己的递归删除视图代码或者是否有可用的代码.

android

6
推荐指数
1
解决办法
5017
查看次数

按Java代码更改<layer-item>项

我有以下XML:

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

<item android:id="@+id/customPlayerProgressBg">
    <shape>
        <gradient
                android:startColor="#FF999999"
                android:endColor="#FF999999"
        />
    </shape>
</item>

<item android:id="@+id/customPlayerProgressSecondary">
    <clip>
        <shape>
            <gradient
                    android:startColor="#FF5C3C68"
                    android:endColor="#FF5C3C68"
            />
        </shape>
    </clip>
</item>
<item
    android:id="@+id/customPlayerProgress"
>
    <clip>
        <shape>
            <gradient
                android:startColor="#FF5C3C68"
                android:endColor="#FF5C3C68"
            />
        </shape>
    </clip>
</item>

</layer-list>
Run Code Online (Sandbox Code Playgroud)

我想通过Java代码更改"customPlayerProgress"和"customPlayerProgressSecondary".怎么能实现呢?

android android-drawable

6
推荐指数
1
解决办法
4608
查看次数

单击更改ListView的文本颜色

我有一个自定义ListView列表的每一行由一个ImageView和两个组成TextView.我想在单击列表项目时将文本的颜色更改为白色(仅在单击的项目中).此外,当项目"未被点击"时(当"按下"被释放时),我想将颜色更改为黑色.单击以下内容时,我已经使项目的背景颜色发生了变化list_item_bg.xml:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item 
    android:state_selected="false"
    android:state_pressed="false" 
    android:drawable="@color/white" />

<item android:state_pressed="true" 
    android:drawable="@color/red_destaques" />

<item android:state_selected="true"
    android:drawable="@color/red_destaques" />
</selector>
Run Code Online (Sandbox Code Playgroud)

而且listitem_row.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    android:id="@+id/relativeLayout1"
    android:layout_width="fill_parent"
    android:layout_height="50dip"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:padding="5dip"
    android:maxHeight="50dip"
    android:adjustViewBounds="true"
    android:background="@color/list_item_bg">

    <ImageView
        android:layout_width="70dip"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:adjustViewBounds="true"
        android:scaleType="fitStart" 
        android:src="@drawable/imagem_padrao_lista" 
        android:id="@+id/listItemLogo">
    </ImageView>

    <TextView
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:layout_height="wrap_content"
        android:text="TextView"
        android:layout_width="wrap_content"
        android:layout_toRightOf="@+id/listItemLogo"
        android:layout_toLeftOf="@+id/listItemArrow"
        android:textColor="#000000"
        android:layout_marginLeft="5dip"
        android:adjustViewBounds="true" 
        android:id="@+id/listItemTitle">
    </TextView>

    <TextView
        android:layout_height="wrap_content"
        android:text="TextView"
        android:layout_width="wrap_content"
        android:layout_toRightOf="@+id/listItemLogo"
        android:layout_below="@+id/listItemTitle"
        android:textColor="#333333"
        android:layout_marginLeft="5dip"
        android:adjustViewBounds="true" 
        android:id="@+id/listItemDescription">
    </TextView>
    <ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_alignParentRight="true" android:src="@drawable/setinha_navegacao" …
Run Code Online (Sandbox Code Playgroud)

customization android listview

4
推荐指数
1
解决办法
9614
查看次数

通过代码SeekBar minHeight和maxHeight

有人知道如何SeekBar通过代码设置最小和最大高度吗?我想重现与以下XML摘录相同的行为:

<SeekBar android:minHeight="6dip"
         android:maxHeight="6dip" ... />
Run Code Online (Sandbox Code Playgroud)

android seekbar

4
推荐指数
1
解决办法
2961
查看次数

如何通过代码获取应用程序名称?

如何在基于Windows 8的应用程序中通过javascript代码获取应用程序名称?

编辑:更精确:我想要package.appxmanifest中的String - >应用程序UI - >显示名称

microsoft-metro windows-8

4
推荐指数
1
解决办法
1851
查看次数

如何从 Unity 上的 C# 静态类获取当前文件夹

我导入了一个 Unity 包,其中多个编辑器脚本依赖于RootPath静态类的属性:

public static class EditorUtils
{
    public static string RootPath => "Assets/HardcodedPath";
}
Run Code Online (Sandbox Code Playgroud)

问题在于该路径是硬编码的,因此包位置根本无法更改。我计划更改该RootPath属性,以便它获取当前脚本位置并使用给定模式搜索父文件夹。这样,即使在我自己的自定义包中(即在 Packages 文件夹而不是 Assets 文件夹中),我也可以使用此包。

缺少的部分是我找不到从代码中获取此静态类文件夹位置的方法。谁能帮我这个?

c# unity-game-engine

2
推荐指数
1
解决办法
3787
查看次数