GridLayout溢出屏幕

时间:2017-11-12 11:45:42

标签: android android-gridlayout

所以我是android的新手,一直试图在网格布局中排列文本视图。我遇到的问题是文本溢出屏幕。我已经研究过,但我能得到的唯一解决方案就是使用android:layout_columnWeight;不幸的是,我正在使用API​​ 19,但我知道在API 21之前不支持该属性。我可以在这里获得一些帮助吗?

我已经包含了快照和.xml代码以方便您使用。谢谢!

import time
import discord
import random
from discord.ext import commands

bot = commands.Bot(command_prefix=',', description='Enjoy Being Slapped 
Randomly')
intervalM = random.randint(5,15)
#intervalS = integerM * 60

@bot.event
async def on_ready():
    print('Logged in as')
    print(bot.user.name)

@bot.command()
async def slapInt(integer):
    await bot.say("Time Between Slaps is now... " + str(integer) + "min")
    intervalM = integer

@bot.command()
"""manually slap someone"""
async def slapMan(intervalM, user):
    #debug - await bot.say("oof " + str(intervalM))
    intervalS = float(intervalM) * 60
    await bot.say("Slapping someone in " + str(intervalS) + " seconds")
    for i in range(0,int(intervalS)+1):
        if i == int(intervalS):
            await bot.say(" just got slapped!")
            intervalM = random.randint(5,15)
            slap(intervalM)
        else:
            #await bot.say(i)
            time.sleep(1)

def slap(intervalM):
    intervalS = float(intervalM) * 60
    print("Slapping someone in " + str(intervalS) + " seconds")
    for i in range(0,int(intervalS)+1):
        if i == int(intervalS):
            print(" just got slapped!")
            intervalM = random.randint(5,15)
            slap(intervalM)
        else:
            #await bot.say(i)
            time.sleep(1)

bot.run('~~~~~~~~~')
slap(intervalM)

enter image description here

0 个答案:

没有答案