In the cantilever and the cantilever manufacturing method of the present invention, at least a part of the retaining portion is formed of a shape-memory material (e.g., shape-memory metal or polymer), and undergoes expansion and contraction under an influence of an external factor, such as heat, electric field, or magnetic field.