我正在研究react-native。我遵循网站上的教程。当我执行" react-native run-ios"。它发生了一些错误消息。
public class VerticalAdapter extends RecyclerView.Adapter<VerticalAdapter.ViewHolder> {
private Context context;
String link;
List<TextJson> listmodel;
private Activity parentActivity;
public VerticalAdapter(List<TextJson> listmodel, Context context) {
super();
this.listmodel = listmodel;
this.context = context;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext())
.inflate(R.layout.text_virtically, parent, false);
ViewHolder viewHolder = new ViewHolder(v);
return viewHolder;
}
@Override
public void onBindViewHolder(ViewHolder holder, final int position) {
TextJson model = listmodel.get(position);
holder.textViewName.setText(model.getText_status());
holder.textViewName.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
link = listmodel.get(position).getText_status();
return true;
}
});
}
@Override
public int getItemCount() {
return listmodel.size();
}
class ViewHolder extends RecyclerView.ViewHolder {
public TextView textViewName;
public ViewHolder(View itemView) {
super(itemView);
textViewName = (TextView) itemView.findViewById(R.id.texting_status);
}
}
}
我发现/ Users / Mapple / Library / LaunchAgents中没有file-com.github.facebook.watchman.plist。我试过各种各样的方法,但它没有发挥作用 我会疯了。
包版本:
1.node:v6.1.0
2.watchman:4.6.0
答案 0 :(得分:0)
我解决了我的问题。我的目录中有一个名为“org.lantern.plist”的文件。我猜这是因为Lantern软件。所以当我删除/ Users / Mapple / Library / LaunchAgents并重新创建它时,并重新执行命令“react-native init HelloWorld”,我的问题已经解决了。