English 中文(简体)
甲型六氯环己烷中多纽吨的图像
原标题:Use image as multiple buttons in Android

I want to use the below image as a five different buttons. In addition, the image must stay at the bottom of the screen. Any ideas on how can I accomplish this? enter image description here

最佳回答

如果你只想使用一种图像,那是可能的,但却是困难的,这不是最佳选择,因为你必须根据这些装置照顾大面积。 但正如我所说的那样,这并非不可能。 你们必须发现 f子在哪里做主,然后用一些数学确定哪些是“丁顿”的。

为探测主线,您可使用“

问题回答

否则就没有工作了。 最好的选择是分割图像,单独使用。

也许你们也必须为分裂者单独树立形象。

try using this

 tabHost = (TabHost)findViewById(android.R.id.tabhost);
           Intent intent1 = new Intent(this, javaclass.class);
        TabSpec tab1 = tabHost.newTabSpec("tid1");
        ImageView img1 = new ImageView(this);
            img1.setLayoutParams(new LayoutParams(tabWidth, tabHeight));
        img1.setBackgroundColor(Color.TRANSPARENT);
            tab1.setIndicator(img1).setContent(intent1);

如下文所示为Xml Layout的背景

<RelativeLayout
            android:id="@+id/layTab"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:paddingLeft="10dp"
            android:paddingRight="10dp"
            android:background="@drawable/image"
            android:layout_alignParentBottom="true"
            android:layout_centerVertical="true"
            >
            <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            />
        </RelativeLayout>

You could look into ImageButtons and define your background. As for splitting up I am unsure but I guess it is always possible to have 1 for each "button" and just align them neatly.

yap, 你们可以使用上面的表象,然后将这种图像分解成每个表象,并将这种表象添加到表象中,并 back回像样。





相关问题
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 ...

热门标签