English 中文(简体)
是否有可能将“Marquee”写进一个延伸到“农民”的植被?
原标题:Is it possible for TextView Marquee in a Widget that extends AppWidgetProvider?

我是安乐斯方案拟定工作的非常新鲜事,我已读到任何地方,我似乎无法找到任何解决办法。

Basic problem is that I have a TextView in a widget and I would like the text to scroll when the text is longer than the TextView layout_width. This is my code in the layout_widget.xml

    <TextView android:id="@+id/fact" android:layout_width="200dp"
            android:text="Loading... More text to see if it spans or not and want more"
            android:singleLine="true" 
            android:ellipsize="marquee"
            android:marqueeRepeatLimit ="marquee_forever"
            android:scrollHorizontally="true"
            android:focusable="true"
            android:focusableInTouchMode="true" />

现在我的理解是,我必须把案文放在重点上,我已经这样做。 我也读到,你需要确定setS selected(true) 的财产,这是我正在努力确定的情况。 在我的缺席活动中(安妮·曼尼费斯·xml) 我有以下法典。

            @Override
            public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.widget_layout);
                findViewById(R.id.fact).setSelected(true);
                setContentView(R.layout.main);
            }

The part below is used to set the content to the widget_layout.xml and subsequently set the textView property for setS selected to real

                setContentView(R.layout.widget_layout);
                findViewById(R.id.fact).setSelected(true);

然后,我将内容意见退回主编。

现在,我猜测这是错误的,这不是应该做的。 但是,我很想知道能否做到这一点。 我也读到,如果你能够推翻《框架》,你也可以把自己的财产列入,例如《意见》中? 我也谈到SDK版本7。

我非常赞赏我得到的帮助,感谢大家!

Edit: By removing setContentView(R.layout.main); when launching the application via the app draw, the text does scroll, but the widget doesn t. Kind of leads me to that a widget cannot have a marquee??? Has anyone got a marquee working on a widget??

www.un.org/Depts/DGACM/index_spanish.htm Edit2: Solved。 这就是如何做到这一点。

在案文的xml中,你需要一个标签 基本上,我认为,这和被欺骗(真实)一样。

So the code should be as followed:

    <TextView android:id="@+id/fact" android:layout_width="200dp"
            android:text="Loading... More text to see if it spans or not and want more"
            android:singleLine="true" 
            android:ellipsize="marquee"
            android:marqueeRepeatLimit ="marquee_forever"
            android:scrollHorizontally="true"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:duplicateParentState="true">
        <requestFocus android:focusable="true" android:focusableInTouchMode="true"
            android:duplicateParentState="true" />
    </TextView>
最佳回答

溶解。 这就是如何做到这一点。

In the xml for the text view you need to have a tag This basically I think is the same as getSeleted(true);

因此,应当遵循以下准则:

<TextView android:id="@+id/fact" android:layout_width="200dp"
        android:text="Loading... More text to see if it spans or not and want more"
        android:singleLine="true" 
        android:ellipsize="marquee"
        android:marqueeRepeatLimit ="marquee_forever"
        android:scrollHorizontally="true"
        android:focusable="true"
        android:focusableInTouchMode="true"
        android:duplicateParentState="true">
    <requestFocus android:focusable="true" android:focusableInTouchMode="true"
        android:duplicateParentState="true" />
</TextView>
问题回答

页: 1 两次:

setContentView(R.layout.widget_layout);
findViewById(R.id.fact).setSelected(true);
setContentView(R.layout.main);

你的活动只能有一条规定。 如果widget_layout 是贵重植被的布局,包括案文观点,那么你不希望有第二条<代码>。





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

热门标签