0

I have 4 keys in my telegram bot api with InlineKeyboardMarkup, but when i send it for android client size of buttons is too small that user can see.In web client of telegram these icons is ok and have very well size !

enter image description here

Is there any way to set buttons size in InlineKeyboardMarkup like ReplyKeyboardMarkup and resize_keyboard parameter? or customize these buttons size and ... ?

class Ctmp: pass
ctobj = Ctmp()
ii = 0
a = []
for k, v in ddd.items() :
    if ( len(k) > 0 and len(v) > 0 ) :
        print(k, v)
        setattr(ctobj, 'repkey'+ str(i),  InlineKeyboardButton(text= str(v), callback_data=str(k), resize_keyboard=True))
        a.append( getattr(ctobj, 'repkey' + str(i)) )
        ++ii

repl = InlineKeyboardMarkup([a])
bot.sendMessage(chat_id= dd.get("chatid", None), text="/", reply_markup=repl)
alireza
  • 1,173
  • 4
  • 19
  • 40

1 Answers1

2

The size of the buttons automatically gets adapted to the content of the buttons. You can't change the size of the buttons yourself.

On certain devices there are problems when the content is not completely trimmed. So:

  1. Make sure you are setting a Button text
  2. Make sure all leading and trailing blanks, new lines are removed.
Maak
  • 4,720
  • 3
  • 28
  • 39