小编Kim*_*ano的帖子

Xcode中的"找不到框架"

我知道有几次这样问过.我按照这些说明进行操作:

在Xcode 5中添加框架到项目并添加了*relative*路径

xcode4:链接器错误:找不到选项的目录

Xcode仍然给出了这个错误:

在此输入图像描述

这是我目前的配置:

在此输入图像描述

在此输入图像描述

螺栓框架是我可以使用Parse SDK.我从这里下载了空白项目:https://parse.com/apps/quickstart#parse_data/mobile/ios/native/new

它正在发挥作用.我试图复制每个配置选项,但它仍然无法正常工作.

xcode ios ios-frameworks xcode6

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

Realm Exception'value'不是有效的托管对象

我在一个领域对象上设置一个属性与另一个领域对象是一个不同的类,但是我得到了错误:'value'不是avalid托管对象.

realmObject.setAnotherRealmObject(classInstance.returnAnotherRealmObjectWithValues())
Run Code Online (Sandbox Code Playgroud)

类实例接收anotherRealmObject构造函数,并使用来自小部件的值通过该方法返回它:

public ClassInstance(AnotherRealmObject anotherRealmObject){
  mAnotherRealmObject = anotherRealmObject;
}

public AnotherRealmObject returnAnotherRealmObjectWithValues(){
       mAnotherRealmObject.setId(RandomUtil.randomNumbersAndLetters(5));
       mAnotherRealmObject.setName(etName.getText().toString());

       return mAnotherRealmObject;
}
Run Code Online (Sandbox Code Playgroud)

我正在以正确的方式创建新的另一个领域对象(我认为):

mAnotherRealmObject = mRealmInstance.createObject(AnotherRealmObject.class);
Run Code Online (Sandbox Code Playgroud)

是因为我正在返回另一个因为传递引用而已被修改的另一个对象吗?

android realm

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

改造关闭响应机构

我一直在收到这个错误:

 A connection to ****** was leaked. Did you forget to close a response body?
Run Code Online (Sandbox Code Playgroud)

所以我继续关闭我得到的回复.

response.body().close()
Run Code Online (Sandbox Code Playgroud)

问题是如果response.body()已经转换为自定义类,则没有可用的close方法.我也尝试调用raw并给我一个例外:

fetchSomething.enqueue(new Callback<SomethingClass>() {
            @Override
            public void onResponse(Call<SomethingClass> call, Response<SomethingClass> response) {


                //Closes the response body
                response.raw().body().close(); //<--- gives illegalStateException

            }

            @Override
            public void onFailure(Call<SomethingClass> call, Throwable t) {

            }
        });

    }
Run Code Online (Sandbox Code Playgroud)

我怎么关闭它?

android retrofit okhttp retrofit2 okhttp3

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

NSObject和AnyObject有什么区别?什么时候用这两个?

我正在尝试创建一个数组来存储字符串或自定义类的数组.我最好创建一本字典吗?

xcode ios swift

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

RecyclerView中的视图与父宽度不匹配

我有一个水平的Recyclerview:

<android.support.v7.widget.RecyclerView
        android:id="@+id/rvRecommendedVendors"
        android:scrollbars="none"
        android:layout_width="match_parent"
        android:layout_height="225dp"
        android:visibility="visible"
        android:layout_below="@+id/llRecommendedVendors"
        android:overScrollMode="never"
        android:background="@color/dark_blue"
        />
Run Code Online (Sandbox Code Playgroud)

它有一个项目:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ImageButton
        android:layout_width="match_parent"
        android:layout_height="225dp"
        android:id="@+id/ibRecommendedCoverPhoto"
        android:src="@drawable/sample_cover_image"
        android:background="@android:color/darker_gray"
        android:scaleType="centerCrop"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

两个控件的宽度都设置为match_parent但是,imagebutton不会"匹配"其父级的宽度.

我记录了宽度:

recyclerView高度:338
recyclerView宽度:480

这是来自Recyclerview方法onCreateViewHolder:

  @Override
    public RecommendedVendorsViewHolder onCreateViewHolder(ViewGroup vg, int viewType) {
    View v = LayoutInflater.from(vg.getContext()).inflate(R.layout.item_recommended_list, vg, false);
Run Code Online (Sandbox Code Playgroud)

我记录了视图的高度和宽度:

查看v高度:338
查看宽度:327

我尝试以编程方式设置宽度:

@Override
    public RecommendedVendorsViewHolder onCreateViewHolder(ViewGroup vg, int viewType) {
        View v = LayoutInflater.from(vg.getContext()).inflate(R.layout.item_recommended_list, vg, false);
        RecyclerView.LayoutParams params= (RecyclerView.LayoutParams)v.getLayoutParams();
        params.width=480;
        v.setLayoutParams(params);

        return vh;
    }
Run Code Online (Sandbox Code Playgroud)

查看v高度:338
查看宽度:480

它工作,但我不想每次调整视图的大小.

android android-recyclerview

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

检查领域对象是否有任何更改

如果结果中的 realmObject 值发生了变化,有没有办法检测它?

Account account = mRealmInstance.where(Account.class).equalTo("isLoggedIn", true).findFirst();

account.setName("New Name");

if(account.hasChanged()){ //Is there a realmMethod for this?

}
Run Code Online (Sandbox Code Playgroud)

java android realm

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

Android 密码 XML 属性 - 已弃用

我现在如何屏蔽 editText?

在此处输入图片说明

我的 inputType 是数字。我现在应该如何屏蔽它并同时将其限制为数字?

java android android-layout android-edittext android-studio

3
推荐指数
1
解决办法
2551
查看次数

Android Nougat 7.1.1 showAtLocation(...) 重力不起作用

这与这个问题相关: Android Nougat PopupWindow showAsDropDown(...) Gravity notworking

但是,当我应用此修复程序时:

if (android.os.Build.VERSION.SDK_INT >=24) {
    int[] a = new int[2];
    anchorView.getLocationInWindow(a);
    popUp.showAtLocation(((Activity) mContext).getWindow().getDecorView(), Gravity.NO_GRAVITY, 0 , a[1]+anchorView.getHeight());
} else{
    popUp.showAsDropDown(anchorView);
}
Run Code Online (Sandbox Code Playgroud)

它不适用于 Android Nougat 7.1.1。特别是在 Google Pixel 和 Nexus 6p 设备上。

有人解决这个问题了吗?请分享。 https://code.google.com/p/android/issues/detail?id=231487

android android-popupwindow android-7.1-nougat

3
推荐指数
1
解决办法
3260
查看次数