Pedestrian dead reckoning (PDR) is a self-contained positioning technology and has been a significant research topic in recent years. Pedestrian-stride-length estimation is the core part of the PDR system and directly affects the performance of the PDR. The current stride-length-estimation method is difficult to adapt to changes in pedestrian walking speed, which leads to a rapid increase in the error of the PDR. In this paper, a new deep-learning model based on long short-term memory (LSTM) and Transformer, LT-StrideNet, is proposed to estimate pedestrian-stride length. Next, a shank-mounted PDR framework is built based on the proposed stride-length-estimation method. In the PDR framework, the detection of pedestrian stride is achieved by peak detection with a dynamic threshold. An extended Kalman filter (EKF) model is adopted to fuse the gyroscope, accelerometer, and magnetometer. The experimental results show that the proposed stride-length-estimation method can effectively adapt to changes in pedestrian walking speed, and our PDR framework has excellent positioning performance.