import streamlit as st
html_code = """
<!DOCTYPE html>
<html>
<head>
<title>Disable Pull to Refresh</title>
<script>
// 禁用下拉刷新功能
document.addEventListener('touchmove', function(event) {
if (event.touches.length > 1) {
event.preventDefault();
}
}, { passive: false });
document.addEventListener('touchstart', function(event) {
if (event.touches.length > 1) {
event.preventDefault();
}
}, { passive: false });
</script>
</head>
<body>
<h1>Streamlit App</h1>
</body>
</html>
"""
st.components.v1.html(html_code, height=200)
st.write("这是你的Streamlit应用内容。")
——————@
import streamlit as st
html_code = """
<style>
/ 隐藏右下角的Home按钮 /
.css-1lsmgbg.egzxvld1 {
display: none;
}
</style>
"""
st.components.v1.html(html_code, height=0)
st.write("这是你的Streamlit应用内容。")