If you don’t appreciate iPhone's capacity to alter screen by itself, chances are high that you've most likely disabled auto-brightness on your iOS device. It just requires you go to "Display & Brightness" settings and turn it off. But sadly, on the iOS 11 version, you can’t follow the same practice anymore.
In earlier versions of iOS, Auto-Brightness feature was located in the Display & Brightness window. But in the iOS 11, the location of the toggle is changed and put deep into the settings option (At least, that’s what I think). Though it is really a useful tool that makes use of ambient light sensors built into iOS devices.
Get to Settings > General. This will open the General window that will enable you to personalize general settings for your an iOS 11 device.
Select Accessibility > Display Accommodations. This will pop-up the Display Accommodations window that lets you personalize the display settings as per your convenience.
Click the Auto Brightness toggle button located on the Display Accommodations window. It will disable the Auto-Brightness feature your iOS 11 device.
Most of us may still be contented with the Auto-Brightness feature, but many must be struggling with iOS 11 brightness problem. For instance, if Auto-Brightness is adjusted a bit wrong, you will be simply running for a shady place on a full sunny day. Though in re-adjusting it, iOS will learn and will try to offer you same brightness next time.
Now, as I have made it simple for you, try it and let me know more about it (In case I have missed anything).