我有一个单一活动的简单应用程序.实际上,启动器图标与活动的图标(左上角的图标)相同.我想在我的活动中添加另一个图标而不改变发射器的一个.
这是我的清单:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.natinusala.pebkac.MainActivity"
android:label="@string/app_name">
<intent-filter android:logo="@drawable/pebkac">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Run Code Online (Sandbox Code Playgroud)
实际上,我可以通过编辑android:icon="@drawable/ic_launcher"线来编辑启动器和活动图标.我也可以添加一个android:icon,<activity>但它也修改了启动器的图标.
如何在不触及启动器的情况下编辑活动图标?
谢谢 !
我正在尝试使用strftime和法语语言环境格式化日期LC_TIME.我有一个编码问题,不是日期本身,而是格式字符串.
让我解释 ; 在我的例子中,$format是%A %d %B à %Hh%M和$time日期是八月的某个地方.
我首先从这开始:strftime($format, $time)它给了我Vendredi 05 Ao?t à 11h57.
我想解决编码问题,所以我做了这个:utf8_encode(strftime($format, $time)),这给了我这个:Vendredi 05 Août à 11h57.
您可以看到编码问题août已经消失,但是à在格式字符串上出现了一个问题.
我该如何解决这个问题?我必须做utf8_encode(strftime("%A %d %B", $time)) . " à " . utf8_encode(strftime("%Hh%M", $time))或有更干净的方式吗?
谢谢 !
我有一些LinearLayout包含一些东西的对象,包括两个TextViews。不幸的是,我在他们之间有一个巨大的空间,我不知道为什么。
自己看(在内容框架和#642954 - 14/25/9814事物之间):
http://i.stack.imgur.com/832QN.png
这是我的代码:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<ImageView
android:id="@+id/img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:contentDescription="@string/smiley"
android:padding="10dp"
/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:includeFontPadding="false"
>
<TextView android:id="@+id/contenu"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/round"
android:padding="10dp"
android:layout_margin="5dp"
android:includeFontPadding="false"
android:layout_marginBottom="-10dp"
/>
<TextView android:id="@+id/infos"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="right"
android:layout_margin="5dp"
android:includeFontPadding="false"
android:padding="0dp"
android:layout_marginTop="-10dp"
/>
</LinearLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
这是round.xml:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="rectangle" >
<solid android:color="#20000000" />
<corners android:radius="13dp" />
</shape>
</item>
<item android:bottom="2px">
<shape xmlns:android="http://schemas.android.com/apk/res/android" > …Run Code Online (Sandbox Code Playgroud)