How to create field instance with display none programmatically I tried to create some fields and field instance programmatically in .install file. 

And I need to set a specail field instance with display none.

I have google, but got nothing.

Does anyone have a solution ?
your question is not very clear.

What do you mean "display none"?


Make your field in the .install file.
Add a CSS file to your module info filefiles[]=mymodule.css
in the CSS file of your module .field-myfield {display:none;}.
clear your drupal cache


EDIT

I think you probably want to look at Field Permissions module.


  The Field Permissions module allows site administrators to set
  field-level permissions to edit, view and create fields on any entity.