小编Sur*_*wah的帖子

如何在按钮上更改drawableLeft图标大小?

我在4个按钮上添加了一些图标,它们在按钮旁边看起来很大.那么我该如何调整它们的大小呢?我在按钮上使用了drawableLeft来添加图标.

drawables被称为交易,奖杯,拼图和扩音器.图标太大了.content_main.xml文件:

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/content_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="tr.k12.evrim.evrimnews.MainActivity"
    tools:showIn="@layout/activity_main">




    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/frameLayout"
        android:layout_alignParentTop="true"
        android:layout_alignParentStart="true">


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Giri? Yap"
                android:onClick="SignIn"
                android:textStyle="bold"
                style="@style/Widget.AppCompat.Button.Colored"/>




            </LinearLayout>


    </FrameLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="400dp"
        android:layout_below="@id/frameLayout"
        android:orientation="vertical">



    <Button
        android:text="Duyurular"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:layout_below="@+id/frameLayout"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="13dp"
        android:id="@+id/button2"
        android:drawableLeft="@drawable/megaphone" />

    <Button
        android:text="Kadromuz"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:layout_below="@+id/button2"
        android:layout_alignEnd="@+id/button2"
        android:layout_marginTop="13dp"
        android:id="@+id/button3"
        android:drawableLeft="@drawable/puzzle"/>

        <Button
            android:text="Ba?ar?lar?m?z"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:layout_marginTop="12dp"
            android:id="@+id/button5"
            android:drawableLeft="@drawable/trophy"/>


    <Button
        android:text="Ortaklar?m?z"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:layout_marginTop="12dp"
        android:id="@+id/button4" …
Run Code Online (Sandbox Code Playgroud)

android

50
推荐指数
8
解决办法
5万
查看次数

使用Vector Drawable Compat

我正在制作一个带有几个片段的Android应用程序.在其中一个片段中,我有一个带有后箭头的工具栏作为图像按钮.
在XML文件中,我有"app:srcCompat"属性,但是在使用这个属性时我得到一个错误:"要使用VectorDrawableCompat,你需要设置'android.defaultConfig.vectorDrawables.useSupportLibrary = true'

android android-vectordrawable

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

错误类型3:活动类{...}不存在

AndroidManifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.m.e"
      android:versionCode="5"
      android:versionName="3.0">

<uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18"/>

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">
    <activity
            android:name="com.m.e"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:configChanges="orientation|keyboardHidden">
        <intent-filter>
            <action
                    android:name="android.intent.action.MAIN"
                    />

            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
    <activity
            android:name="com.m.e"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:configChanges="orientation|keyboardHidden">
        <intent-filter>
            <action
                    android:name="android.intent.action.first"
                   />

            <category android:name="android.intent.category.DEFAULT"/>
        </intent-filter>
    </activity>

    .....

</application>

</manifest>
Run Code Online (Sandbox Code Playgroud)

错误:

 Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.m.e/.Splash }
 Error type 3
 Error: Activity class {com.m.e/com.m.e.Splash} does not exist.
Run Code Online (Sandbox Code Playgroud)

注意: .Splash 确实存在.

android android-manifest

30
推荐指数
10
解决办法
6万
查看次数

由于某个应用遮挡了权限请求,因此“设置”无法验证您的回复

在此处输入图片说明当我允许USB调试时,点击“确定”按钮,消息已到

由于某个应用遮挡了权限请求,因此“设置”无法验证您的回复

错误在于允许USB调试。

android

14
推荐指数
9
解决办法
4万
查看次数

无法将react-native 2项目构建到手机上

我的反应天真的项目已完全设置并且一直试图将它运行到我的手机但是当我运行时我得到以下错误

react-native run-android

命令.

输出:

java.io.IOException:无法运行程序"/home/webshinobis/Android/sdk/build-tools/23.0.1/aapt":error = 2,没有这样的文件或目录

但我检查了构建工具,那个文件就在那里.我重新安装了23.0.1的构建工具但没有变化.有什么想法要帮忙吗?谢谢.

sdk android react-native

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

在openfire中延迟群发消息

我使用Openfire(xmpp)服务器构建了一个聊天应用程序.一对一的人聊天工作正常,消息即时传递.但是当我们在组内发送消息时,第一条消息会被延迟,第二条消息会立即传递.

MultiUserChatManager groupChat =
          MultiUserChatManager.getInstanceFor(connection).getMultiUserChat("group_name");
groupChat.send("Message object");
Run Code Online (Sandbox Code Playgroud)

为什么第一条消息会被延迟?

MUC创作是

 MultiUserChatManager mchatManager = MultiUserChatManager.getInstanceFor(xmpptcpConnection);
      MultiUserChat mchat = mchatManager.getMultiUserChat(group);
      if (!mchat.isJoined()) {
        Log.d("CONNECT", "Joining room !! " + group + " and username " + username);
        boolean createNow = false;
        try {
          mchat.createOrJoin(username);
          createNow = true;
        } catch (Exception e) {
          Log.d("CONNECT", "Error while creating the room " + group + e.getMessage());
        }

        if (createNow) {

          Form form = mchat.getConfigurationForm();
          Form submitForm = form.createAnswerForm();

          List<FormField> formFieldList = submitForm.getFields();
          for (FormField formField : …
Run Code Online (Sandbox Code Playgroud)

android openfire smack

10
推荐指数
1
解决办法
419
查看次数

Android签名apk签名V2

我正在使用android studio版本2.2.2和gradle版本2.2.2开发Android应用程序.我正在尝试生成签名的APK.我做了使用Android Studio生成签名APK的常规流程.在那之后,我做了Zipalign处理.生成的APK在Android 6下工作正常.但在Android N的情况下,它在安装APK时显示以下错误:

    Failed to install C:\Users\User\AppData\Roaming\Skype\My Skype Received Files\ap
p-dev3-release_zipalign.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Fail
ed to collect certificates from /data/app/vmdl25816781.tmp/base.apk: META-INF/CE
RT.SF indicates /data/app/vmdl25816781.tmp/base.apk is signed using APK Signatur
e Scheme v2, but no such signature was found. Signature stripped?]
Run Code Online (Sandbox Code Playgroud)

根据Android studio 2.2的文档,它会自动注册签名V1和V2.我做错了吗?需要一些帮助.

android zipalign signed-apk

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

Android studio连接重置错误?

我最近更新了android studio 2.2.2.现在,当我检查sdks并将依赖项添加到build.gradle时,我遇到了连接重置错误.我不知道这个.指导我删除此错误.

此搜索

ide android android-studio

8
推荐指数
1
解决办法
9261
查看次数

引起:java.lang.ClassNotFoundException:没有找到类"android.webkit.SafeBrowsingResponse"

我在我的应用程序中使用WebView,而加载内容警告日志来自logcat,如下所示

 Caused by: java.lang.ClassNotFoundException: Didn't find class "android.webkit.SafeBrowsingResponse" on path: DexPathList[[zip file "/data/app/com.android.chrome-1/base.apk"],nativeLibraryDirectories=[/data/app/com.android.chrome-1/lib/arm, /data/app/com.android.chrome-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]  
Run Code Online (Sandbox Code Playgroud)

那个应用程序一次又一次崩溃之后

04-25 09:46:49.219 26505-26505/com.abc W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
04-25 09:46:49.219 26505-26505/com.abc W/google-breakpad: Chrome build fingerprint:
04-25 09:46:49.219 26505-26505/com.abc W/google-breakpad: 5.0.7lab
04-25 09:46:49.219 26505-26505/com.abc W/google-breakpad: 58
04-25 09:46:49.219 26505-26505/com.abc W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
04-25 09:46:49.219 26505-26505/com.whence A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr …
Run Code Online (Sandbox Code Playgroud)

android

8
推荐指数
1
解决办法
6326
查看次数

无法实例化接收器com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver

我最近在Google Play上更新了我的应用,发现当机错误消息是:

Unable to instantiate receiver com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
Run Code Online (Sandbox Code Playgroud)

更新仅改变了广告的频率,没有其他改变。我正在使用firebase-core和firebase-ads。仅当从Play商店安装应用而不是通过adb安装应用或不在设备上本地安装APK时才发生崩溃-崩溃似乎也仅在首次打开时发生。目前,我已从我的应用程序中删除了firebase-core和firebase-ads,并正在等待应用程序在商店中更新。

更新:删除firebase-core和firebase-ads似乎已解决了该问题。虽然,我仍然想在我的应用程序中使用Firebase。

谢谢。

android firebase

7
推荐指数
1
解决办法
3199
查看次数