probably this is old article but still I confused. I have custom object called candidate. I have created field name called first name and read only in page layout. once record is created in candidate object with first name field called xxx then again I am able to edit first name field. why I am able to edit (I mean getting pencil icon). Can anyone suggest me for this issue.
Are you doing this as a system admin?
System Admin profile has the option "Edit Read Only Fields" under "Administrative Permissions" and this means that profile is always able to edit read only fields.
Try logging in as a user with a different profile.