小编Ada*_*atz的帖子

如何向React Native应用程序添加图标

我正在制作一个React Native应用程序.我想自定义应用程序图标(表示您单击以启动应用程序的图标).我用Google搜索了这个,但我一直在寻找不同类型的图标来引用不同的东西.如何将这些类型的图标添加到应用程序?

icons react-native

243
推荐指数
10
解决办法
12万
查看次数

如何设置react-native android的启动画面

如何设置反应原生android的启动画面,我找不到任何关于该主题的内容,我认为这很奇怪.

谢谢

android react-native

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

使水平回收者视图项的宽度为屏幕宽度的70%

我想创造这种效果

设计图像

我正在使用回收站视图,但我的问题是,每张卡都是100%的屏幕宽度,为70%.

这是每个项目的xml代码

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/rowLayout"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="@dimen/scale_20dp">

    <LinearLayout
        android:id="@+id/button_parent"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <android.support.v7.widget.CardView
            android:id="@+id/card_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <LinearLayout
                android:id="@+id/currentYear"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:background="@drawable/paymentscreengrey"
                android:gravity="center"
                android:orientation="vertical"
                android:paddingLeft="35dp"
                android:paddingTop="@dimen/scale_50dp">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/scale_20dp"
                    android:text="****   ****   ****   5432"
                    android:textColor="@color/white"
                    android:textSize="@dimen/scale_20dp" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="2345"
                    android:textColor="@color/white"
                    android:textSize="@dimen/scale_16dp" />
Run Code Online (Sandbox Code Playgroud)

xml android android-layout

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

ItemTouchHelper使拖动的项目超过片段页脚

我有一个RecyclerViewItemTouchHelper.RecyclerView是一个2/2网格,页面上有页眉和页脚.当用户拿起一个项目时,我希望该项目能够悬停在页脚上.但是,我不希望通过页脚看到回收器视图中的其他项目.

所以首先我尝试添加clipChildren,clipPadding但是这会产生一种情况,即RecyclerView项目在页脚中向上滚动这是一个问题.我尝试为项目添加高程并带来ToFont,但那些从未工作过,因为回收者视图仍然在页脚后面,我尝试添加到前面的回收器视图本身,但然后再一次所有项目再次成为页脚前面而不是只是拖了一个,有没有人有任何其他想法如何解决这个问题?

android

13
推荐指数
1
解决办法
915
查看次数

Recycler视图不调用getItemCount

我刚刚创建了一个回收器视图,但它没有工作,所以我在getItemCount上放了一个断点,并且没有调用该方法.我从未见过其他任何人都有这个特殊问题,我相信这是非常明显的事情.这是我的代码.

public class SearchAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

private ArrayList<Object> displayList;

public static class ViewHolder extends RecyclerView.ViewHolder {
    public ViewHolder(View v) {
        super(v);
    }
}

public class ErrorSearchItem extends ViewHolder {
    //this is here if there is no other viewholder

    public ErrorSearchItem(View view) {
        super(view);

    }
}

public class HeaderViewHolder extends ViewHolder {


    public HeaderViewHolder(View view) {
        super(view);

    }
}



@Override
public int getItemViewType(int position) {

    return position;
}

public SearchAdapter(ArrayList<Object> displayList) {
    this.displayList = displayList;
}

@Override
public ViewHolder onCreateViewHolder(ViewGroup …
Run Code Online (Sandbox Code Playgroud)

android android-recyclerview

12
推荐指数
2
解决办法
4033
查看次数

尝试为N手机创建Whatsapps快速回复

如果您点击通知上的快速回复按钮,我正在尝试创建一个小窗口.在WhatsApp中,它打开了一个半屏幕窗口.目前我正在做以下事情:

我打开了一个叫做的活动NotificationActivity.在AndroidManifest.xml我注册的活动中

<activity
    android:name=".activity.NotificationActivity"
    android:theme="@style/Theme.AppCompat.Light.Dialog.custom"
    android:label="@string/title_activity_notification"
    android:screenOrientation="portrait"
    android:windowSoftInputMode="adjustResize|stateHidden" />
Run Code Online (Sandbox Code Playgroud)

这是风格:

<style name="Theme.AppCompat.Light.Dialog.custom">
    <item name="windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
</style>
Run Code Online (Sandbox Code Playgroud)

现在,当应用程序完全关闭(关闭然后刷掉)时,它可以完美地运行.

但是,如果应用程序只是最小化,当有人点击回复按钮时,它会打开应用程序,然后将NotificationActivity粘贴到它上面.如何阻止应用程序在后台打开并且仅打开半屏通知活动.

非常感谢

编辑:我在想,也许xml文件是相关的?

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="300dp"
    android:layout_marginTop="15dp"
    android:background="@color/white"
    android:orientation="vertical"
    android:paddingTop="12dp"
    android:weightSum="20">

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

        <android.support.v7.widget.RecyclerView
            android:id="@+id/lvChat"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="10"
            android:background="@android:color/transparent"
            android:cacheColorHint="@android:color/transparent"
            android:divider="@android:color/transparent"
            android:dividerHeight="0dp"
            android:listSelector="@android:color/transparent"
            android:scrollbars="none"
            android:stackFromBottom="false"
            android:transcriptMode="alwaysScroll"/>

        <LinearLayout
            android:id="@+id/chatFooter"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#ECEFF1"
            android:orientation="horizontal">

            <LinearLayout
                android:id="@+id/sendLayout"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center_vertical"
                android:paddingBottom="@dimen/scale_5dp"
                android:paddingTop="@dimen/scale_5dp"
                android:weightSum="2">

                <LinearLayout
                    android:layout_width='0dp'
                    android:layout_height="wrap_content"
                    android:layout_weight="1.8">

                    <com.heyjude.heyjudeapp.customview.EditRobotoRegular
                        android:id="@+id/editChatMsg"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="@drawable/linear_back"
                        android:hint="Type your message..."
                        android:imeOptions="actionSend" …
Run Code Online (Sandbox Code Playgroud)

notifications android

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

仅对一页反应原生景观模式

是否有可能在本机反应中使应用程序以纵向模式运行但是在横向模式下运行一个页面?我知道在xcode中你必须在开头选择肖像或风景,所以我对如何制作应用程序肖像中的所有页面有点困惑,除了一个.

react-native

9
推荐指数
2
解决办法
4418
查看次数

React Native在genymotion中加载Android应用程序

我正在尝试在本机中构建一个Android应用程序.我遵循了官方指南并下载了genymotion并在本机中创建了一个新项目.如何在genymotion中打开我的项目?

我在终端中收到以下错误

FAILURE:构建因异常而失败.

  • 其中:构建文件'/Users/adamkatz/Projects/testAndroid/android/app/build.gradle'行:69

  • 出了什么问题:评估项目':app'时出现问题.

    找不到SDK位置.使用sdk.dir在local.properties文件中或使用ANDROID_HOME环境变量定义位置.

  • 尝试:使用--stacktrace选项运行以获取堆栈跟踪.使用--info或--debug选项运行以获取更多日志输出.

建筑失败

总时间:6.504秒无法在设备上安装应用程序,请阅读上述错误以获取详细信息.确保运行Android模拟器或连接设备并设置Android开发环境:https: //facebook.github.io/react-native/docs/android-setup.html

当我添加以下导出ANDROID_HOME =/usr/local/opt/android-sdk

我收到以下错误消息

FAILURE:构建因异常而失败.

  • 出了什么问题:配置项目':app'时出现问题.

    找不到Build Tools修订版23.0.1

  • 尝试:使用--stacktrace选项运行以获取堆栈跟踪.使用--info或--debug选项运行以获取更多日志输出.

建筑失败

总时间:3.735秒无法在设备上安装应用程序,请阅读上述错误以获取详细信息.确保运行Android模拟器或连接设备并设置Android开发环境:https: //facebook.github.io/react-native/docs/android-setup.html

react-native

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

如何从react-native-gesture-handler禁用矩形按钮

标题几乎就是问题。在反应本机按钮上,即 touchableOpacity 上,您具有禁用的道具,但它似乎不适用于 RectButton

<RectButton onPress={onPress} disabled={isDisabled}></RectButton>
Run Code Online (Sandbox Code Playgroud)

不起作用

button react-native react-native-gesture-handler

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

react-native自定义android工具栏

我有一个工具栏,目前看起来像这样

<ToolbarAndroid
        title='WWF'
        style={styles.toolbar}
        navIcon={require("./App/assets/logo.png")}
        logo={require("./App/assets/logo.png")}
        actions={[{title: 'list', show: 'always'}, {title: 'partners', show: 'always'}, {title: 'about',  show: 'always'}]}
        onActionSelected={this.onActionSelected} />
Run Code Online (Sandbox Code Playgroud)

是否可以更改徽标的大小和位置?目前它左边有一个边距,我想让它坐在屏幕的左下角,并可能使它更宽.

也可以将两个图像彼此相邻作为徽标吗?

谢谢

android react-native

5
推荐指数
1
解决办法
3094
查看次数