Loading [MathJax]/jax/output/CommonHTML/config.js
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >阻止文本视图移出屏幕

阻止文本视图移出屏幕
EN

Stack Overflow用户
提问于 2020-06-02 15:39:15
回答 1查看 52关注 0票数 0

我正在尝试在android studio中做一个应用程序。我有一个圆形背景的文本视图。问题是,当我把它安装在一个物理设备上时,屏幕上的文本视图就消失了。她在android studio中的预览:

Xml代码:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
             <?xml version="1.0" encoding="utf-8"?>
            <RelativeLayout 

             xmlns:android="http://schemas.android.com/apk/res/android"
             xmlns:app="http://schemas.android.com/apk/res-auto"
             xmlns:tools="http://schemas.android.com/tools"
            android:layout_width="match_parent"
           android:layout_height="match_parent"
            android:background="#000000"
>

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_alignParentTop="true">


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="55dp"
            android:orientation="horizontal"
            android:background="@drawable/top_bar">

            <TextView
                android:id="@+id/textView3"
                android:layout_width="40dp"
                android:layout_height="match_parent"
                android:layout_weight="0"

           android:drawableLeft="@drawable/ic_keyboard_arrow_left_black_24dp"

                />

            <TextView
                android:id="@+id/textView5"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:fontFamily="@font/segoeui"
                android:gravity="center_vertical|start"
                android:text="App name and image"

                android:textColor="#FFFFFF"
                android:textSize="30dp" />

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="45dp"
            android:orientation="vertical">

            <TextView
                android:id="@+id/textView6"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:fontFamily="@font/segoeui"
                android:gravity="center"
                android:text="Pakistan vs Australia T20"
                android:textColor="#ffff"
                android:textSize="24dp" />

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="1.5dp"
            android:background="#ffff"
            android:orientation="vertical"
            android:layout_marginLeft="47dp"
            android:layout_marginRight="47dp"></LinearLayout>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="300dp"
            android:orientation="horizontal">

            <LinearLayout
                android:layout_width="247dp"
                android:layout_height="match_parent"
                android:orientation="vertical">


                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="40dp"
                    android:gravity="center"
                    android:orientation="horizontal">

                    <TextView
                        android:id="@+id/textView2"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:fontFamily="@font/segoeui"
                        android:gravity="center"
                        android:text="Match Odds"
                        android:textColor="#ffff"
                        android:textSize="17dp" />

                    <TextView
                        android:id="@+id/textView"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:fontFamily="@font/segoeui"
                        android:paddingLeft="10dp"
                        android:text="Favourite"
                        android:textColor="#ffff"
                        android:textSize="17dp" />
                </LinearLayout>


                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:layout_marginTop="30dp"
                        android:orientation="horizontal">

                        <TextView
                            android:id="@+id/textView12"
                            android:layout_width="40dp"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="0"
                            android:textColor="#ffff"
                            android:textSize="20dp"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/textView11"
                            android:layout_width="20dp"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="-"
                            android:textColor="#ffff"
                            android:textSize="20dp"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/textView10"
                            android:layout_width="40dp"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="0"
                            android:textColor="#ffff"
                            android:textSize="20dp"
                            android:textStyle="bold" />
                    </LinearLayout>


                    <TextView
                        android:id="@+id/textView13"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="40dp"
                        android:layout_marginTop="30dp"
                        android:fontFamily="@font/segoeui"
                        android:gravity="center"
                        android:text="WestIndies"
                        android:textColor="#ffff"
                        android:textSize="16dp"


                        android:visibility="visible" />


                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="5dp"
                    android:orientation="horizontal">

                    <TextView
                        android:id="@+id/textView4"
                        android:layout_width="100dp"
                        android:layout_height="1dp"
                        android:layout_marginLeft="6dp"

                        android:background="@color/margins"
                        android:text="TextView" />

                    <TextView
                        android:id="@+id/textView7"
                        android:layout_width="100dp"
                        android:layout_height="1dp"
                        android:layout_marginLeft="30dp"
                        android:background="@color/margins"
                        android:text="TextView" />
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:orientation="horizontal">

                    <TextView
                        android:id="@+id/textView9"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:fontFamily="@font/segoeui"
                        android:gravity="center"
                        android:text="Session"
                        android:textColor="#ffff"
                        android:textSize="17dp" />

                    <TextView
                        android:id="@+id/textView8"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:fontFamily="@font/segoeui"
                        android:gravity="center"
                        android:text="Runs/Balls"
                        android:textColor="#ffff"
                        android:textSize="17dp" />
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="20dp"
                    android:orientation="horizontal">

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:orientation="horizontal">

                        <TextView
                            android:id="@+id/textView17"
                            android:layout_width="40dp"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="0"
                            android:textColor="#FF0000"
                            android:textSize="20dp"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/textView18"
                            android:layout_width="20dp"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="-"
                            android:textColor="#ffff"
                            android:textSize="20dp"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/textView19"
                            android:layout_width="40dp"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="0"
                            android:textColor="#ffff"
                            android:textSize="20dp"
                            android:textStyle="bold" />
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="match_parent"
                        android:orientation="horizontal">

                    </LinearLayout>
                </LinearLayout>


            </LinearLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_marginLeft="0dp"
                android:orientation="vertical"
                >

                <TextView
                    android:id="@+id/TextViewID"
                    android:layout_width="110dp"
                    android:layout_height="110dp"
                    android:layout_marginTop="80dp"
                    android:layout_marginLeft="35dp"
                    android:background="@drawable/green_circle"
                    android:gravity="center"
                    android:text="2"
                    android:textColor="#ff2800"
                    android:textSize="13sp" />
            </LinearLayout>


        </LinearLayout>


    </LinearLayout>
</ScrollView>

  </RelativeLayout>

我在屏幕上看到了什么:

我尝试过使用不同屏幕尺寸的不同设备,但都得到了相同的结果。我怎么才能解决这个问题。TIA..!

EN

回答 1

Stack Overflow用户

发布于 2020-06-02 16:11:44

我认为这是因为圆形TextView所在的LinearLayout实际上是另一个具有水平方向的LinearLayout的子级,并且在它之前有另一个宽度为250dp的空LinearLayout,这会将相关布局推出屏幕。您是否可以尝试删除空的LinearLayout,看看是否有帮助?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62155755

复制
相关文章
Android蓝牙开发(二)之蓝牙配对和蓝牙连接
上篇文章:https://blog.csdn.net/huangliniqng/article/details/82185983
黄林晴
2019/01/10
4.4K0
Android蓝牙开发(二)之蓝牙配对和蓝牙连接
上篇文章:https://blog.csdn.net/huangliniqng/article/details/82185983
全栈程序员站长
2022/09/07
3.3K0
Android蓝牙配对弹出框过程分析 Android蓝牙配对弹出框过程分析
Android蓝牙配对弹出框过程分析 根据远程蓝牙设备(remote devices)的要求,手机端发起与远程蓝牙设备Bluetooth remote Device的配对有两种情况 第一种:配对时需要pin码(pin request event)即有配对请求pairing request :所对应的action为 : BluetoothDevice.ACTION_PAIRING_REQUEST。  根据远程设备所携带的type信息判断是否可以获取到pairingkey      type值通过Blu
fanfan
2018/01/24
5.9K0
Android 9.0 蓝牙配对流程
DeviceListPreferenceFragment是蓝牙扫描到的设备列表,点击其中一个蓝牙设备,调用onPreferenceTreeClick方法开始蓝牙的配对过程。
用户7557625
2020/07/15
2.2K0
Android蓝牙配对弹出框过程分析
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zrf1335348191/article/details/54020225
fanfan
2019/05/27
3.1K0
android开发之蓝牙主动配对连接手机
上一篇介绍了手机配对连接的三种方式,这篇以完整的一个代码实例介绍如何搜索周围的蓝牙设备,以及主动配对,连接。
全栈程序员站长
2022/03/11
7540
Android BLE 蓝牙开发,连接蓝牙设备进行通讯
讲解如何通过 UUID 连接蓝牙设备。如果你针对 GATT 服务不太了解。那么这篇应该能够稍微帮助到你。
zinyan.com
2023/07/14
5.7K0
Android BLE 蓝牙开发,连接蓝牙设备进行通讯
NDSS2019议题解读:通过恶意蓝牙外设打破安卓安全机制
原文标题:Breaking Android Security Mechanisms via Malicious Bluetooth Peripherals
绿盟科技研究通讯
2019/12/11
2.4K0
NDSS2019议题解读:通过恶意蓝牙外设打破安卓安全机制
android开发之蓝牙配对连接的方法「建议收藏」
最近在做蓝牙开锁的小项目,手机去连接单片机总是出现问题,和手机的连接也不稳定,看了不少蓝牙方面的文档,做了个关于蓝牙连接的小结。
全栈程序员站长
2022/03/11
4K0
无需用户确认关闭当前网页
如果我们在使用window.close的时候,IE下会出现这样的提示,告知用户是否确认关闭当前的网页(如下图所示)
meteoric
2019/02/25
1.7K0
无需用户确认关闭当前网页
使用saripaar对android输入控件进行快速验证
该文介绍了如何使用saripaar库对Android输入控件进行快速验证。首先介绍了什么是saripaar,然后详细描述了如何使用saripaar进行输入控件的验证,并给出了示例代码。
MJ.Zhou
2018/01/04
1.5K0
如何使用Android-PIN-Bruteforce爆破Android的锁屏密码
在这篇文章中,我们将教大家如何通过暴力破解Android手机的锁屏密码来解锁Android设备。并介绍Android-PIN-Bruteforce工具,该工具可以将你的Kali Nethunter手机转换成一台针对Android设备的暴力破解PIN码设备,而且无需进行Root也无需adb。
FB客服
2021/05/20
3.4K0
如何使用Android-PIN-Bruteforce爆破Android的锁屏密码
Android 蓝牙操作
该BluetoothAdapter可以执行基本的蓝牙任务,例如启动设备发现,查询配对的设备列表,使用已知的MAC地址实例化一个BluetoothDevice类,并创建一个BluetoothServerSocket监听来自其他设备的连接请求
码客说
2019/10/22
1.5K0
android蓝牙测试
注意点:在执行getBondedDevices时候会花费一点时间,一开始我不知道,“已配对”一直没出现,以为出错了。后来上了趟厕所回来发现就有了!!!!尴尬!
提莫队长
2019/02/21
1K0
Android 蓝牙开发(1)
Android 平台包含蓝牙网络堆栈支持,凭借此支持,设备能以无线方式与其他蓝牙设备交换数据。应用框架提供了通过 Android Bluetooth API 访问蓝牙功能的途径。使用 Bluetooth API Android 应用可以执行下面的操作:
开发者
2019/12/26
2.5K0
Android 蓝牙4.0
相对其他传输方式的优势(蓝牙2.1,3.0,wifi): 1,相对wifi和zigbee无线方案,蓝牙和无线射频模块nRF24l01成本会低很多,wifi的好处是可以比较方便实现远程控制,距离比较远,信号也相对比较稳定。 2,健康类的应用有人做出产品的 但不是基于蓝牙4.0低功耗的 还是用蓝牙2.1的spp协议来做的,蓝牙2.1或者3.0的耗电是个比较大的问题,一些小外设,需要用纽扣电池的应用就无法真正使用,对一些创意产品如果需要经常换电池或充电对用户体验都会大打折扣,成本也会大大提高。 3,iPho
用户1733354
2018/05/22
1.3K0
Android开发笔记(一百六十二)蓝牙设备的连接与配对
蓝牙是一种短距离无线通信技术,它由爱立信公司于1994年创制,原本想替代连接电信设备的数据线,但是后来发现它也能用于移动设备之间的数据传输,所以蓝牙技术在手机上获得了长足发展。 因为手机内部的通讯芯片一般同时集成了2G/3G/4G、WIFI和蓝牙,所以蓝牙功能已经是智能手机的标配了。若想进行蓝牙方面的开发,需要在App工程的AndroidManifest.xml中补充下面的权限配置:
aqi00
2019/01/18
3.4K0
Android蓝牙开发(一)之打开蓝牙和设备搜索
https://blog.csdn.net/huangliniqng/article/details/82185635
黄林晴
2019/01/10
2.4K0
Android蓝牙开发—经典蓝牙和BLE(低功耗)蓝牙的区别
最近在做蓝牙开发,刚接触时傻傻的分不清经典蓝牙和低功耗蓝牙的区别,一直用开发低功耗蓝牙的方法去连接经典蓝牙设备,最后当然是一直连接不上了。在此记录下经典蓝牙和低功耗蓝牙的区别和联系。
全栈程序员站长
2022/07/05
5K0
Android蓝牙开发—经典蓝牙和BLE(低功耗)蓝牙的区别
点击加载更多

相似问题

android蓝牙配对无需用户pin输入即可编程实现

114

Android -无需配对即可连接多个蓝牙设备

13

android无需配对即可通过蓝牙发送文件

11

无需用户配对确认即可将蓝牙与Zebra打印机配对

12

无需用户确认的蓝牙配对

61
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文