TEL:400-8793-956
当前位置:程序、服务器

日间布局问题

提问者: 近期获赞: 浏览人数: 发布时间:2021-02-28 09:16:15

 问:因此,我按照讲座中的指示设计了日列表视图布局。我已经将temperatureLabel与作为背景的圆形图像视图对齐,并且还将重力设置为center。但是,每次我在模拟器中运行该应用程序时,都会在圆圈顶部附近而不是中心附近显示temperatureLabel。预览正确显示了温度标签居中对齐,但运行时并非如此。

 
 
答:添加以下行“ android:layout_centerVertical =“ true””为我修复了此行
 
< TextView 
android:layout_width = “ wrap_content” android:layout_height = “ wrap_content” android:id = “ @ + id / temperatureLabel” android:layout_alignTop = “ @ + id / circleImageView” android:layout_alignBottom = “ @ + id / circleImageView” android :layout_alignLeft = “ @ + id / circleImageView” android:layout_alignRight = “ @ + id / circleImageView” android:layout_centerVertical = “ true” android:gravity = “ center” android:textColor = “#f25019“工具:文本=    
 
    “ 100” />
上一篇: 如何在图片周围放置链接,而不是src?我很困惑
下一篇: PHP开发