I have custom object called candidate. I have created field name called first name which is read-only in the page layout. Once a record is created with first name field populated I am able to edit that field. Why I am able to edit (I mean getting pencil icon). Can anyone suggest me for this issue?
By Default Sys Admins can edit the Read Only field marked in Layouts. So you can check this using by using a different profile first.
If you need to make some field mark as read-only for Sys Admins then you have to go to Object Manager-> Select Object -> Fields & Relationships-> Select the Field and on the top, there is a button called 'Set Field Level Security'.
And there mark the check box read-only for the Sys Admins.