The formation mechanism and photocatalytic activity of hierarchical NiAl-LDH films on an Al substrate prepared under acidic conditions.