Pulsars are rapidly spinning and highly magnetized neutron stars, with highly stable rotational period and gradual spin-down over a long timescale due to the loss of radiation. Glitches refer to the events that suddenly increase the rotational speed of a pulsar. The exact causes of glitches and the resulting processes are not fully understood. It is generally believed that couplings between the normal matter and the superfluid components, and the starquakes, are the common causes of glitches. In this study, one famous glitching pulsar, PSR~J2021+4026, is investigated. PSR~J2021+4026 is the first variable gamma-ray pulsar observed by Fermi. From the gamma-ray observations, it is found that the pulsar experienced a significant flux drop, an increase in the spin-down rate, a change in the pulse profile and a shift in the spectral cut-off to a lower energy, simultaneously around 2011 October 16. To explain these effects on the high-energy emissions by the glitch of PSR~J2021+4026, we hypothesized the glitch to be caused by the rearrangement of the surface magnetic field due to the crustal plate tectonic activities on the pulsar which is triggered by a starquake. In this glitch event, the inclination angle of the magnetic dipole axis is slightly shifted. This proposition is then tested by numerical modeling using a three-dimensional two-layer outer gap model. The simulation results indicate that a modification of the inclination angle can affect the pulse profile and the spectral properties, which can explain the observation changes after the glitch.