English 中文(简体)
能否让用户定制9种可提取的颜色?
原标题:Would it be possible to let the user customize the color of a .9 drawable?

Pretty much what the title says. I m wanting the user to have the choice to customize the boarder of a 9 drawable I have. Is something like that possible or do I need to use a different method? Right now, I think it won t work and it will mess up the 9 patch.

最佳回答

您的9个派系的照片吗? 可能将其部分从另一类可提取,然后在固定部分使用一层清单,将可定制部分(用用户界定的颜色取而代)层。

<<>>> 根据你所展示的景象,我 t淡了层次清单的想法,但我们仍可以做一些事情。 想法是把有色边界和内部黑暗背景完全从9个飞地(以阴影的颜色和不透明地填入该地区)移走。 之后,相互之间只有3个。 第一是把9个派用作背景。 其次,将使用用户界定的颜色作为背景。 第三,将利用你的小组肤色作为背景。 这9个电话将为定位第二版(用户-color)布局提供适当的空间,然后,你只增加一个布局,即向第二小组分配一些最便衣的地块。

<LinearLayout
    android:id="@+id/PanelOuter"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/shadow_nine_patch">
    <LinearLayout
        android:id="@+id/PanelUserBorder"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/custom_border_width"
        android:background="@color/dialog_border_color_default">
        <LinearLayout
            android:id="@+id/PanelContent"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/custom_dialog_content_margin"
            android:background="@color/dialog_inner_color">
        </LinearLayout>
    </LinearLayout>
</LinearLayout>

当然,你负责找到<代码>。 PanelUserBorder view incode and calls setBackgroundColor(>,并有适当的用户界定的颜色。

问题回答

也许你可以把50%的透明观点压倒了纽子。

在思考后,认为你可以按比照图改变肤色:

如何改变比特马图图像色谱和roid?





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签