小编Zoo*_*bie的帖子

如何设置Toast显示时间小于Toast.LENGTH_SHORT

我想要显示比Toast.LENGTH_SHORT更少的吐司,因为我觉得它需要大约2秒钟.我想要显示吐司只有半秒钟.

什么是Toast.LENGTH_SHORT和Toast.LENGTH_LONG的时间间隔?

android toast

24
推荐指数
3
解决办法
5万
查看次数

用户点击主页按钮后将应用程序带到前面

我的应用程序处于运行模式[前景],用户点击主页按钮,这将应用程序置于后台[并仍在运行].我的应用程序中有警报功能,它会启动.我想要的是当我的闹钟响起时,我希望将我的后台运行应用程序放在前台并从最后状态开始.

    <application
            android:name="nl.ziggo.android.state.management.MainEPGApp"
            android:icon="@drawable/icon"
            android:label="@string/app_name"
            android:largeHeap="true"
            android:logo="@drawable/app_logo" >
            <activity
                android:name=".SplashScreen"
                android:label="@string/app_name"
                android:launchMode="singleTop"
                android:screenOrientation="nosensor"
                android:theme="@style/Theme.Sherlock" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        <activity
                    android:name=".Starter"
                    android:configChanges="orientation|screenSize"
                    android:screenOrientation="behind"
                    android:launchMode="singleTop"
                    android:uiOptions="none"
                    android:windowSoftInputMode="adjustPan" />
</application>
Run Code Online (Sandbox Code Playgroud)

android

20
推荐指数
5
解决办法
4万
查看次数

android:应用程序中的screenOrientation标签不起作用

android:screenOrientation当放置在标签<application>不起作用.但是,当我把android:screenOrientation一个<activity>标记它的工作原理.

如果android:screenOrientation标签在<application>那时起作用,则不需要android:screenOrientation为每个活动进行处理.

我想知道,为什么Android平台上有这种奇怪的行为screenOrientation标签?

android screen-orientation

11
推荐指数
1
解决办法
1万
查看次数

如果添加了footerview,则分隔符将从listview中的最后一项消失

如果在ListView中添加了页脚视图,则分隔符将从ListView的最后一项中消失.

即使我已经android:footerDividersEnabled="true"使用ListView 设置,我的页脚视图只是TextTiew.

android listview divider

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

按钮,标题和副标题中的两个文本

我们可以创建一些带有标题和副标题文本的自定义按钮.

按钮上部的标题和下面的副标题.

android button

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

如何通过java代码更改android:layout_alignParentRight运行时

我有聊天列表视图,其中发送者名称应该左对齐,接收者的回复应该在右侧,然后当接收者成为发送者时反之亦然.

这是我的xml文件:

<?xml version="1.0" encoding="utf-8"?>
Run Code Online (Sandbox Code Playgroud)

<TextView android:id="@+id/chatmessagename"
    android:layout_width="fill_parent" android:layout_height="wrap_content"
    android:layout_alignParentLeft="true" 
    android:layout_alignParentTop="true"
    android:textSize="16sp" android:textStyle="bold"
    android:paddingBottom="1dp" />
<TextView android:id="@+id/chatmessagedate"
    android:layout_width="wrap_content" android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_alignParentTop="true"    
    android:autoLink="none" />
<TextView android:id="@+id/chatmessagetext"
    android:layout_width="wrap_content" android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_below="@id/chatmessagename"
    android:autoLink="all" />
Run Code Online (Sandbox Code Playgroud)

现在在运行时我想更改textview的layout_alignParentRight值.有可能吗?

android android-layout

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