English 中文(简体)
Swipe通过美术馆
原标题:Swipe through Gallery

我正在制造一种图象,我需要通过我的画廊中的图像来抹去。 我也利用Sencha Touch。 这使我能够顺利地通过图像抹去,但我需要一位头脑,把我所看到的图像保存起来。 For eg: 1/5, 2/5 and so.

有什么想法?

我将特别赞赏该守则。

最佳回答

在文法中使用文法和美术。

<?xml version="1.0" encoding="utf-8"?>    
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:gravity="center_horizontal" >

    <TextView android:id="@+id/tv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" /> 

    <Gallery android:id="@+id/gal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:spacing="10px" />
</LinearLayout>

在 Java档案中,onCreate()

TextView textView;
Gallery gallery;

如下文:

textView = (TextView)findViewById(R.id.tv);
txtview.setText("1/"+count); // count is a variable which contains total no.of items in gallery
// Initially the item in Gallery is 1st one so, i took "1/"

其次,美术馆如下:

gallery = (Gallery) findViewById(R.id.gal);

我认为,你知道如何安排美术馆,所以在此不作解释。

http://www.un.org/Depts/DGACM/index_chinese.htm

    gallery.setOnTouchListener(new View.OnTouchListener() {         
        public boolean onTouch(View v, MotionEvent event) {             
            int position = gallery.getSelectedItemPosition();
            txtview.setText(""+(position+1)+"/"+count);
            return false;
        }            
    });

上面的法典将显示美术馆在 Gal瓜时的位置。

        gallery.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView parent, View v, int position, long id) {
                textView .setText(""+(position+1)+"/"+count);
            }
        });

The above code will display the position of Gallery Item when you click an item in the Galley.

我希望你们会理解这一点,如果任何怀疑都感到可以向我提问。

问题回答

Have you tried this library, Jquery Touchwipe

它在安乐公司工作





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签