百度一下搜索成功界面

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>

        .container {
            width: 1400px;
            background-color: pink;
        }

        .container > div {
            float: left;
        }

        .container1 {
            width: 1400px;
            background-color: pink;
        }

        .container1 > div {
            float: left;
            height: 36px;
        }

        .left-box {
            width: 125px;
            height: 38px;

        }

        .left-box1 {
            width: 540px;
            height: 36px;
            background-color: white;
            border: 1px solid #3385ff;
        }


        .right-box {
            width: 100px;
            height: 38px;
            background-color: #3388FF;
            color: white;
            text-align: center;
            line-height: 38px;


        }

        input {
            outline: none;
            border: 0;
            height: 34px;
            width: 500px;
            margin-left: 5px;
        }

        #left-box2 {
            width: 1400px;
            height: 36px;
            background-color: #f8f8f8;
            margin-top: 10px;
            padding-left: 125px;
            line-height: 36px;;
        }

        #left-box2 > a {
            text-decoration: none;
            color: #666;
        }

        #left-box3 {
            width: 1400px;
            height: 1000px;
            background-color: white;
            padding-left: 125px;


        }

        .container3 {
            width: 1400px;
            height: 100%;
            padding-top: 80px;

        }

        #left-box3-1 {
            width: 713px;
            height: 100%;
            background-color: white;
            float: left;
        }

        #left-box3-2 {
            width: 538px;
            height: 36px;
            background-color: white;
        }

        #left-box3-2 > a {
            text-decoration: none;
            color: #666;
        }

        #left-box3-3 {
            width: 661px;
            height: 24px;
            background-color: white;
            margin-top: 10px;
        }

        #left-box3-4 {
            width: 661px;
            height: 75px;
            background-color: white;
            margin-top: 10px;
        }

        #left-box3-5 {
            width: 661px;
            height: 24px;
            background-color: white;
            margin-top: 10px;
        }

        #left-box3-6 {
            width: 661px;
            height: 121px;
            background-color: white;
            margin-top: 10px;
        }

        #left-box3-7 {
            width: 661px;
            height: 24px;
            float: left;
            background-color: white;
            margin-top: 10px;
        }

        #left-box3-8 {
            width: 661px;
            height: 140px;
            background-color: white;
            margin-top: 10px;
        }
        #right-box1 {
            width: 2px;
            height: 50%;
            background-color: #cccccc;
            float: left;
            margin-top: 32px;
        }
        .bg {
            display: block;
            position:absolute;
            top:11px;
            right:20px;
            background:url("https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/soutu/img/camera_new_679c15cc.png");
            width:18px;
            height:16px;
            cursor:pointer;
        }
        #right-box2 {
            width: 400px;
            height: 100%;
            background-color: white;
            float: left;
            margin-top: 36px;
        }

        #right-box2-1 {
            width: 400px;
            height: 36px;
            background-color: white;
            padding-left: 10px;
        }

        #right-box3-1 {
            width: 400px;
            height: 140px;
            background-color: white;
            padding-left: 10px;
            float: left;
        }

        #right-box3-1-1 {
            width: 90px;
            height: 140px;
            background-color: white;
            padding-left: 10px;
            float: left;
        }

        #right-box3-1-2 {
            width: 90px;
            height: 140px;
            background-color: white;
            padding-left: 10px;
            float: left;
        }

        #right-box3-1-3 {
            width: 90px;
            height: 140px;
            background-color: white;
            padding-left: 10px;
            float: left;
        }

        #right-box3-1-4 {
            width: 90px;
            height: 140px;
            background-color: white;
            padding-left: 10px;
            float: left;
        }


    </style>
</head>
<body>
<div class="container">
    <div class="left-box" style="position:relative;">
        <img src="//www.baidu.com/img/baidu_jgylogo3.gif" alt="" style="position: absolute">
    </div>
    <div class="left-box1" style="position:relative;">
        <input type="text">
        <i class="bg"></i>
    </div>
    <div class="right-box">
        百度一下
    </div>
    <div style="float: right;font-size: 10px ;line-height: 36px">
        <a href="" style="color: #3388FF">百度首页</a>&nbsp; &nbsp;&nbsp;
        <a href="" style="color: #3388FF">设置</a>&nbsp; &nbsp;&nbsp;
        <a href="" style="color: #3388FF">登陆</a>&nbsp; &nbsp;&nbsp;
    </div>
</div>
<div class="container1">
    <div id="left-box2">
        <a href="">网页</a>&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="">咨询</a>&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="">视频</a>&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="">图片</a>&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="">知道</a>&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="">文库</a>&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="">贴吧</a>&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="">采购</a>&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="">地图</a>&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="">更多></a>&nbsp;&nbsp;&nbsp;&nbsp;
    </div>
</div>
<div class="container3">
    <div id="left-box3">
        <div id="left-box3-1">
            <div id="left-box3-2" style="font-size: 8px ;line-height: 36px ;color: #999"><h2>百度为您找到相关结果约100,000,000个 <a
                    href="" style="float: right;">搜索工具</a></h2>
            </div>
            <div id="left-box3-3">
                <a href="">百度一下,你就知道</a>
            </div>
            <div id="left-box3-4">
                <div style="float: left"><img src="https://ss0.baidu.com/6ONWsjip0QIZ8tyhnq/it/u=2920084749,2018893236&fm=58&s=39C718720E8EBE011B398BAC0300F024&bpow=121&bpoh=75" alt=""></div>
                <div style="font-size: 16px;padding-left: 150px">
                    全球最大的中文搜索引擎、致力于让网民更便捷地获取信息,找到所求。百度超过千亿的中文网页数据库,可以瞬间找到相关的搜索结果。
                    <a href="">https://www.baidu.com/</a><a href=""style="font-size: 10px ;padding-left: 200px;color: #666666">
                    百度快照 - 7616条评价</a></div>
            </div>
            <div id="left-box3-5">
                <a href="" style="float: left">百度-百度百科</a>
            </div>
            <div id="left-box3-6">
                <div style="float: left"><img src="https://ss2.baidu.com/6ONYsjip0QIZ8tyhnq/it/u=2374368971,2673236697&fm=58&bpow=894&bpoh=600" alt=""></div>
                <div style="font-size: 16px;padding-left: 150px">
                    百度(纳斯达克:BIDU),全球最大的中文搜索引擎、最大的中文网站。百度愿景是:成为最懂用户,并能帮助人们成长的全球顶级高科技公司。“百度”二字,来自于八百年前南宋词人...
                </div>
                <a href="" style="padding-left: 30px; font-size: 13px">发展简史 公司理念 财报数据 产品手册 多语言化 更多>></a>
                <br><a href="" style="padding-left: 30px">baike.baidu.com/ </a>
            </div>
            <div id="left-box3-7">
                <a href="">百度地图</a>
            </div>
            <div id="left-box3-8">
                <div style="float: left"><img src="https://ss0.baidu.com/6ONWsjip0QIZ8tyhnq/it/u=248004630,3735300586&fm=58&s=B6D0E8329690B58AFCB89DE60300A0B1&bpow=121&bpoh=75" alt=""></div>
                <div style="font-size: 16px;padding-left: 150px;margin-right: 120px">
                    浏览地图、搜索地点、查询公交驾车线路、查看实时路况,您的出行指南、生活助手。提供地铁线路图浏览,乘车方案查询,以及准确的票价和时间信息。
                </div>
                <a href="" style="padding-left: 30px">https://map.baidu.com/</a><a href=""style="font-size: 10px ;padding-left: 220px;color: #666666">
                百度快照 - 3417条评价</a></div>
        </div>
        <div id="right-box1">
        </div>
        <div id="right-box2">
            <div id="right-box2-1">百度高管 <a href="" style="float: right">展开</a></div>
            <div id="right-box3-1">
                <div id="right-box3-1-1"><img src="https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=2274909088,1858101302&fm=58&bpow=800&bpoh=933" alt=""><a href=""
                                                                    style="padding-left: 20px ; font-size: 15px">李彦宏</a>
                    <p style="font-size: 13px;color: #cccccc">百度创始人董 事长CEO</p></div>
                <div id="right-box3-1-2"><img src="https://ss0.baidu.com/6ONWsjip0QIZ8tyhnq/it/u=103270980,2021432810&fm=58&bpow=550&bpoh=595" alt=""><a href=""
                                                                    style="padding-left: 20px ; font-size: 15px">The Cong</a>
                    <p style="font-size: 13px;color: #cccccc">百度集团首席 财务官</p></div>
                <div id="right-box3-1-3"><img src="https://ss2.baidu.com/6ONYsjip0QIZ8tyhnq/it/u=354071159,237140406&fm=179&app=42&f=JPEG?w=121&h=140" alt=""><a href=""
                                                                    style="padding-left: 20px ; font-size: 15px">PDD</a>
                    <p style="font-size: 13px;color: #cccccc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;百度总裁</p></div>
                <div id="right-box3-1-4"><img src="https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=3545454556,120284015&fm=58&bpow=600&bpoh=900" alt=""><a href=""
                                                                    style="padding-left: 20px ; font-size: 15px">简自豪</a>
                    <p style="font-size: 13px;color: #cccccc">百度集团首席 技术官</p></div>
            </div>
        </div>
    </div>

</div>
</div>

</body>
</html>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在 Android 应用中实现百度地图的搜索界面,你可以按照以下步骤进行: 1. 在项目的 build.gradle 文件中,添加百度地图 SDK 的依赖。例如: ``` dependencies { implementation 'com.baidu.androidsdk:baidumapapi:5.2.0' } ``` 2. 在布局文件中添加一个 MapView 控件,用于显示地图。例如: ``` <com.baidu.mapapi.map.MapView android:id="@+id/map_view" android:layout_width="match_parent" android:layout_height="match_parent" /> ``` 3. 在代码中获取 MapView 对象,并设置一些地图的基本属性。例如: ``` // 获取 MapView 对象 MapView mapView = findViewById(R.id.map_view); // 设置地图缩放级别 BaiduMap baiduMap = mapView.getMap(); baiduMap.setMapStatus(MapStatusUpdateFactory.zoomTo(16)); // 隐藏地图上的缩放控件 mapView.showZoomControls(false); ``` 4. 在布局中添加一个搜索框,用于输入关键词。例如: ``` <EditText android:id="@+id/search_box" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="请输入关键词" /> ``` 5. 在代码中获取 EditText 对象,并设置一个点击事件,当用户点击搜索框时,跳转到搜索界面。例如: ``` // 获取 EditText 对象 EditText searchBox = findViewById(R.id.search_box); // 设置点击事件 searchBox.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this, SearchActivity.class); startActivity(intent); } }); ``` 6. 创建一个新的 Activity,用于显示搜索结果。在这个 Activity 中,你可以使用百度地图 SDK 提供的 PoiSearch 类来进行关键词搜索。例如: ``` public class SearchActivity extends AppCompatActivity { private MapView mapView; private BaiduMap baiduMap; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_search); // 获取 MapView 对象,并设置地图基本属性 mapView = findViewById(R.id.map_view); baiduMap = mapView.getMap(); baiduMap.setMapStatus(MapStatusUpdateFactory.zoomTo(16)); mapView.showZoomControls(false); // 获取搜索关键词 String keyword = getIntent().getStringExtra("keyword"); // 创建 PoiSearch 对象 PoiSearch poiSearch = PoiSearch.newInstance(); poiSearch.setOnGetPoiSearchResultListener(new OnGetPoiSearchResultListener() { @Override public void onGetPoiResult(PoiResult poiResult) { // 处理搜索结果 if (poiResult == null || poiResult.error != SearchResult.ERRORNO.NO_ERROR) { // 搜索失败 Toast.makeText(SearchActivity.this, "搜索失败", Toast.LENGTH_SHORT).show(); return; } // 搜索成功 List<PoiInfo> poiList = poiResult.getAllPoi(); for (PoiInfo poiInfo : poiList) { // 在地图上添加标注 LatLng latLng = new LatLng(poiInfo.getLocation().latitude, poiInfo.getLocation().longitude); BitmapDescriptor bitmap = BitmapDescriptorFactory.fromResource(R.drawable.icon_mark); OverlayOptions options = new MarkerOptions().position(latLng).icon(bitmap); baiduMap.addOverlay(options); } } @Override public void onGetPoiDetailResult(PoiDetailResult poiDetailResult) {} @Override public void onGetPoiIndoorResult(PoiIndoorResult poiIndoorResult) {} @Override public void onGetPoiDetailResult(PoiDetailSearchResult poiDetailSearchResult) {} @Override public void onGetPoiIndoorBuildingInfoResult(PoiIndoorBuildingInfo poiIndoorBuildingInfo) {} }); // 发起搜索请求 PoiCitySearchOption option = new PoiCitySearchOption().city("北京").keyword(keyword); poiSearch.searchInCity(option); } @Override protected void onDestroy() { super.onDestroy(); mapView.onDestroy(); } @Override protected void onResume() { super.onResume(); mapView.onResume(); } @Override protected void onPause() { super.onPause(); mapView.onPause(); } } ``` 在这个 Activity 中,我使用 PoiSearch 类进行关键词搜索,并在地图上添加标注。你可以根据自己的需求进行修改。同时,记得在 AndroidManifest.xml 文件中注册这个 Activity: ``` <activity android:name=".SearchActivity" /> ``` 以上就是在 Android 应用中实现百度地图搜索界面的基本步骤。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值