Okay, so I trust that you know how to add an image to this button.
What I will do however,
is walk you through how to add constraints to this image.
I Ctrl + drag from the button in this direction and
selected the option called Top Space, and then Ctrl + dragged from
the button in this direction and selected Leading Space as the option.
Now I've added two constraints here.
If I select any one of them, and then go to the utility area.
I can look under Size Inspector to see that the value of this constraint is
a constant 50 points from the top.
If I select the other constraint I can see that it's value is
a constant 30 points from the leading edge.
After that I went to the assistant editor and
in there I created a new action called Play Slow audio.
Now, this function gets executed any time someone presses this button over here.
So now, I can write code to play audio in this function.
.حسنًا، لذا، فإنني أثق في معرفتكم كيفية إضافة صورة ما إلى هذا الزر
ومع ذلك، فإنني سأقوم بنقلكم عبر
.كيفية إضافة ثوابت إلى هذه الصورة
لقد قمت بالضغط على Ctrl والسحب من الزر في هذا الاتجاه
وتحديد الخيار الذي يسمى Top Space، ثم قمت بالضغط على Ctrl والسحب من
.الزر في هذا الاتجاه وتحديد مسافة بادئة باعتبارها الخيار
.لقد قمت بإضافة ثابتين الآن هنا
،إذا حددت أي منهما، ثم انتقلت إلى منطقة الأداة المساعدة
فيمكنني النظر أسفل Size Inspector لرؤية أن قيمة هذا الثابت هي
.50 نقطة للثابت من الأعلى
إذا حددت الثابت الآخر، فيمكنني رؤية أن قيمته
.30 نقطة للثابت من الحافة الأولية
بعد ذلك، انتقلت إلى المحرر المساعد
.وهناك، قمت بإنشاء إجراء جديد باسم صوت Play Slow
.الآن، يتم تنفيذ هذه الدالة في أي وقت يضغط شخص ما فيه على هذا الزر هنا
.لذا، فيمكنني الآن كتابة التعليمة البرمجية لتشغيل الصوت في هذه الدالة
Ok, acredito que você saiba como adicionar uma imagem a este botão.
O que vou fazer, no entanto,
é orientá-lo sobre como adicionar restrições a esta imagem.
Pressiono Ctrl e arrasto o botão nesse sentido e
seleciono a opção Top Space e depois pressiono Ctrl e arrasto
o botão nesse sentido e seleciono a opção Leading Space.
Agora adicionei duas restrições aqui.
Se eu selecionar qualquer uma delas e for para a área de utilitário.
Posso olhar em Size Inspector e ver que o valor desta restrição é
uma constante de 50 pontos a partir da parte superior.
Se eu selecionar a outra restrição, posso ver que seu valor é
uma constante de 30 pontos a partir da borda.
Depois, fui para o Assistant editor e
lá criei uma nova ação chamada playSlowAudio.
Essa função é executada toda vez que alguém pressiona esse botão aqui.
Agora, posso escrever um código para reproduzir áudio nesta função.